B
Bill Chiu
Dear C++ Universe,
I wrap pthread lock with a C++ class, and it caused crashes.. Is the
below implementation a real baddy and needs serious spanking??
#include <pthread.h>
class Lock {
public:
Lock() { pthread_mutex_init(&plock, NULL); }
~Lock() {}
void lock() { pthread_mutex_lock(&plock); }
void unlock() { pthread_mutex_unlock(&plock); }
private:
pthread_mutex_t plock;
};
class testdriver {
testdriver();
private:
Lock testlock;
}
testdriver::testdriver() {
}
p.s. I don't want to use boost lib either.
I wrap pthread lock with a C++ class, and it caused crashes.. Is the
below implementation a real baddy and needs serious spanking??
#include <pthread.h>
class Lock {
public:
Lock() { pthread_mutex_init(&plock, NULL); }
~Lock() {}
void lock() { pthread_mutex_lock(&plock); }
void unlock() { pthread_mutex_unlock(&plock); }
private:
pthread_mutex_t plock;
};
class testdriver {
testdriver();
private:
Lock testlock;
}
testdriver::testdriver() {
}
p.s. I don't want to use boost lib either.