haiku/headers/tools/cppunit/LockerSyncObject.h
ejakowatz 52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00

29 lines
793 B
C++

#ifndef _beos_synchronization_object_h_
#define _beos_synchronization_object_h_
#include <cppunit/SynchronizedObject.h>
#include <Locker.h>
/*! \brief BLocker based implementation of CppUnit::SynchronizedObject::SynchronizationObject
*/
class LockerSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
public:
/* LockerSyncObject() : fLock(new BLocker()) {}
virtual ~LockerSyncObject() { cout << 1 << endl; delete fLock; cout << 2 << endl; }
virtual void lock() { fLock->Lock(); }
virtual void unlock() { fLock->Unlock(); }
protected:
BLocker *fLock;
*/
LockerSyncObject() {}
virtual ~LockerSyncObject() {}
virtual void lock() { fLock.Lock(); }
virtual void unlock() { fLock.Unlock(); }
protected:
BLocker fLock;
};
#endif // _beos_synchronization_object_h_