Name
SynchronizedObject
Description
The class
SynchronizedObject
(see Figure C-13) serves
as the parent class for synchronized objects. Synchronized
objects incorporate a mutex-based lock mechanism, allowing
them to be used concurrently by multiple threads.
SynchronizedObject includes the nested classes
SynchronizationObject, which is its mutex object,
and ExclusiveZone, which locks a
SynchronizationObject.
SynchronizedObject belongs to the namespace
CppUnit. It is declared in
SynchronizedObject.h and implemented in
SynchronizedObject.cpp.
![]() |
Declaration
class SynchronizedObject
Constructors/Destructors
-
SynchronizedObject(SynchronizationObject *syncObject = 0) A constructor taking a
SynchronizationObject(mutex.) IfsyncObjectisnull, a newSynchronizationObjectis created.-
virtual ~SynchronizedObject( ) A destructor.
Public Methods
None.
Protected/Private Methods
-
virtual void setSynchronizationObject(SynchronizationObject *syncObject) Sets the
SynchronizationObject.-
SynchronizedObject(const SynchronizedObject ©) A copy constructor declared
privateto prevent its use.-
void operator=(const SynchronizedObject ©) A copy operator declared
privateto prevent its use.
Attributes
-
SynchronizationObject *m_syncObject A pointer to the
SynchronizationObjectfor thisSynchronizedObject(protected).
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
