Replaced QAtomicInt with mt::atomicInt

This commit is contained in:
Paolo Cignoni 2011-12-14 19:22:17 +00:00
parent 1dc98465ae
commit 9779f0f8c7
4 changed files with 6 additions and 7 deletions

View File

@ -7,6 +7,7 @@
#include <vector>
#include <list>
#include <wrap/system/multithreading/mt.h>
#include <wrap/system/multithreading/atomic_int.h>
#include "provider.h"
@ -31,7 +32,7 @@ public:
//if true the cache will exit at the first opportunity
bool quit;
///keeps track of changes (if 1 then something was loaded or dropped
QAtomicInt new_data;
mt::atomicInt new_data;
///callback for new_data
void (*callback)(void *data);
@ -80,7 +81,7 @@ public:
this->heap.clear();
}
if(!s_curr == 0) {
qDebug() << "Cache size after flush is not ZERO!";
std::cerr << "Cache size after flush is not ZERO!\n";
s_curr = 0;
}
}

View File

@ -1,7 +1,6 @@
#ifndef GCACHE_CONTROLLER_H
#define GCACHE_CONTROLLER_H
#include <QDebug>
#include "cache.h"
/** Allows to insert tokens, update priorities and generally control the cache.

View File

@ -26,13 +26,12 @@
#define CACHE_DOOR_H
#include <wrap/system/multithreading/mt.h>
#include <wrap/system/multithreading/atomic_int.h>
#ifdef QT_CORE_LIB
#include <QWaitCondition>
#endif
#include <QAtomicInt>
#define METHOD_2
#ifdef METHOD_1

View File

@ -1,7 +1,7 @@
#ifndef GCACHE_TOKEN_H
#define GCACHE_TOKEN_H
#include <QAtomicInt>
#include <wrap/system/multithreading/atomic_int.h>
/* QAtomic int count keep trak of token status:
>0: locked (possibly multiple times)
@ -34,7 +34,7 @@ class Token {
///swap space used in updatePriorities [do not use, should be private]
Priority tmp_priority;
///reference count of locked items [do not use, should be private]
QAtomicInt count;
mt::atomicInt count;
public:
Token(): count(OUTSIDE) {}