Semaphore based SyncObject
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@156 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a319112563
commit
40ea65d602
31
headers/tools/cppunit/SemaphoreSyncObject.h
Normal file
31
headers/tools/cppunit/SemaphoreSyncObject.h
Normal file
@ -0,0 +1,31 @@
|
||||
#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.
|
||||
*/
|
||||
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_
|
Loading…
Reference in New Issue
Block a user