2003-10-03 03:53:34 +02:00
|
|
|
#ifndef JRD_SMP_IMPL_H
|
|
|
|
#define JRD_SMP_IMPL_H
|
2001-12-24 03:51:06 +01:00
|
|
|
|
|
|
|
#include "../jrd/smp.h"
|
|
|
|
#include "../jrd/thd.h"
|
|
|
|
|
|
|
|
class V4Mutex : public SmpLock
|
|
|
|
{
|
|
|
|
public:
|
2003-03-24 14:35:37 +01:00
|
|
|
V4Mutex() {
|
|
|
|
#ifdef V4_THREADING
|
|
|
|
V4_MUTEX_INIT(&mutex);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
~V4Mutex() {
|
|
|
|
#ifdef V4_THREADING
|
|
|
|
V4_MUTEX_DESTROY(&mutex);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
virtual void aquire(void) {
|
|
|
|
#ifdef V4_THREADING
|
|
|
|
V4_MUTEX_LOCK(&mutex);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
virtual void release(void) {
|
|
|
|
#ifdef V4_THREADING
|
|
|
|
V4_MUTEX_UNLOCK(&mutex);
|
|
|
|
#endif
|
|
|
|
}
|
2001-12-24 03:51:06 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
MUTX mutex;
|
|
|
|
};
|
|
|
|
|
2004-02-20 07:43:27 +01:00
|
|
|
#endif // JRD_SMP_IMPL_H
|
|
|
|
|