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:
|
2005-04-02 05:10:33 +02:00
|
|
|
V4Mutex()
|
|
|
|
{
|
2003-03-24 14:35:37 +01:00
|
|
|
#ifdef V4_THREADING
|
2005-04-02 05:10:33 +02:00
|
|
|
V4_MUTEX_INIT(&mutex);
|
2003-03-24 14:35:37 +01:00
|
|
|
#endif
|
|
|
|
}
|
2005-04-02 05:10:33 +02:00
|
|
|
~V4Mutex()
|
|
|
|
{
|
2003-03-24 14:35:37 +01:00
|
|
|
#ifdef V4_THREADING
|
2005-04-02 05:10:33 +02:00
|
|
|
V4_MUTEX_DESTROY(&mutex);
|
2003-03-24 14:35:37 +01:00
|
|
|
#endif
|
|
|
|
}
|
2005-04-02 05:10:33 +02:00
|
|
|
virtual void acquire(void)
|
|
|
|
{
|
2003-03-24 14:35:37 +01:00
|
|
|
#ifdef V4_THREADING
|
2005-04-02 05:10:33 +02:00
|
|
|
V4_MUTEX_LOCK(&mutex);
|
2003-03-24 14:35:37 +01:00
|
|
|
#endif
|
|
|
|
}
|
2005-04-02 05:10:33 +02:00
|
|
|
virtual void release(void)
|
|
|
|
{
|
2003-03-24 14:35:37 +01:00
|
|
|
#ifdef V4_THREADING
|
2005-04-02 05:10:33 +02:00
|
|
|
V4_MUTEX_UNLOCK(&mutex);
|
2003-03-24 14:35:37 +01:00
|
|
|
#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
|
|
|
|
|