xref: /haiku/src/tools/cppunit/cppunit/SynchronizedObject.cpp (revision 52a380120846174213ccce9c4aab0dda17c72083)
1 #include <cppunit/SynchronizedObject.h>
2 
3 
4 namespace CppUnit
5 {
6 
7 
8 
9 
SynchronizedObject(SynchronizationObject * syncObject)10 SynchronizedObject::SynchronizedObject( SynchronizationObject *syncObject )
11     : m_syncObject( syncObject == 0 ? new SynchronizationObject() :
12                                       syncObject )
13 {
14 }
15 
16 
~SynchronizedObject()17 SynchronizedObject::~SynchronizedObject()
18 {
19   delete m_syncObject;
20 }
21 
22 
23 /** Accept a new synchronization object for protection of this instance
24  * TestResult assumes ownership of the object
25  */
26 void
setSynchronizationObject(SynchronizationObject * syncObject)27 SynchronizedObject::setSynchronizationObject( SynchronizationObject *syncObject )
28 {
29   delete m_syncObject;
30   m_syncObject = syncObject;
31 }
32 
33 
34 } //  namespace CppUnit
35 
36