2002-07-13 00:30:24 +04:00
|
|
|
#ifndef _beos_semaphore_sync_object_h_
|
|
|
|
#define _beos_semaphore_sync_object_h_
|
|
|
|
|
|
|
|
#include <cppunit/SynchronizedObject.h>
|
|
|
|
#include <OS.h>
|
|
|
|
|
|
|
|
//! Semaphore 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.
|
|
|
|
*/
|
2004-02-19 00:38:04 +03:00
|
|
|
class CPPUNIT_API SemaphoreSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject {
|
2002-07-13 00:30:24 +04:00
|
|
|
public:
|
|
|
|
SemaphoreSyncObject();
|
|
|
|
virtual ~SemaphoreSyncObject();
|
|
|
|
|
|
|
|
virtual void lock();
|
|
|
|
virtual void unlock();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
sem_id fSemId;
|
|
|
|
|
|
|
|
private:
|
|
|
|
//! Prevents the use of the copy constructor.
|
|
|
|
SemaphoreSyncObject( const SemaphoreSyncObject © );
|
|
|
|
|
|
|
|
//! Prevents the use of the copy operator.
|
|
|
|
void operator =( const SemaphoreSyncObject © );
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _beos_synchronization_object_h_
|