haiku/headers/tools/cppunit/LockerSyncObject.h
Tyler Dauwalder 0a99bdf489 Fixed multithreaded NextSubTest() output problems
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@157 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-12 20:30:45 +00:00

32 lines
880 B
C++

#ifndef _beos_locker_sync_object_h_
#define _beos_locker_sync_object_h_
#include <cppunit/SynchronizedObject.h>
#include <Locker.h>
//! BLocker based implementation of CppUnit::SynchronizedObject::SynchronizationObject
/*! This class is used to serialize access to a TestResult object. You should
not need to explicitly use it anywhere in your testing code.
*/
class LockerSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
public:
LockerSyncObject() {}
virtual ~LockerSyncObject() {}
virtual void lock() { fLock.Lock(); }
virtual void unlock() { fLock.Unlock(); }
protected:
BLocker fLock;
private:
//! Prevents the use of the copy constructor.
LockerSyncObject( const LockerSyncObject &copy );
//! Prevents the use of the copy operator.
void operator =( const LockerSyncObject &copy );
};
#endif // _beos_synchronization_object_h_