#ifndef THREADPOOL
#define THREADPOOL
-#include <queue>
+#include <list>
+using namespace std;
+
+
#include <pthread.h>
#include <common/Mutex.h>
#include <common/Cond.h>
class ThreadPool {
private:
- queue<T> q;
+ list<T> q;
Mutex q_lock;
Semaphore q_sem;
q_lock.Lock();
{
op = q.front();
- q.pop();
+ q.pop_front();
num_ops--;
if (prefunc && op) {
void put_op(T op) {
tpdout(DBLVL) << ".put_op " << op << endl;
q_lock.Lock();
- q.push(op);
+ q.push_back(op);
num_ops++;
q_sem.Put();
q_lock.Unlock();
_len = len; // my len too
}
void zero() {
- bzero((void*)c_str(), _len);
+ //bzero((void*)c_str(), _len);
+ memset((void*)c_str(), 0, _len);
}
*
*/
-
#ifndef __MDS_TYPES_H
#define __MDS_TYPES_H
using namespace __gnu_cxx;
+#ifndef __uint64_t
+typedef uint64_t __uint64_t;
+#endif
+
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a):(b))
#endif