mirror of
https://review.haiku-os.org/haiku
synced 2025-01-20 05:21:28 +01:00
52a3801208
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
29 lines
793 B
C++
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_
|