diff --git a/headers/tools/cppunit/SemaphoreSyncObject.h b/headers/tools/cppunit/SemaphoreSyncObject.h new file mode 100644 index 0000000000..dd09658e04 --- /dev/null +++ b/headers/tools/cppunit/SemaphoreSyncObject.h @@ -0,0 +1,31 @@ +#ifndef _beos_semaphore_sync_object_h_ +#define _beos_semaphore_sync_object_h_ + +#include +#include + +//! 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. +*/ +class SemaphoreSyncObject : public CppUnit::SynchronizedObject::SynchronizationObject { +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_