#include <LOW_objectSynchronizer.h>
Inheritance diagram for LOW_objectSynchronizer:
Public Member Functions | |
LOW_objectSynchronizer & | operator= (const LOW_objectSynchronizer &inRightSide) |
Protected Member Functions | |
LOW_objectSynchronizer () | |
Constructor. | |
LOW_objectSynchronizer (const LOW_objectSynchronizer &inObjectSynchronizer) | |
Copy constructor. | |
virtual | ~LOW_objectSynchronizer () |
Destructor. | |
Private Attributes | |
LOW_thread_rwlock * | objectSyncRwlock |
Rwlock used for locking. | |
LOW_platformMiscFactory::threadIdent_t | writeLockHolder |
Thread id of the one who's holding a write lock. | |
Friends | |
class | __synchronizeMethodRead |
class | __synchronizeMethodWrite |
class | __synchronizeMethodReadWeak |
class | __synchronizeMethodWriteWeak |
A class which needs synchronization to be thread-save can subclass this class. To serialize the access to a method, simply insert one of the following macros at the beginning of the method:
Note that synchronization is done on object basis.
The implemtation follows the "locking is creation" design pattern and uses a read-write lock. Therefore reentrant calls or successive locking in sub-called methods does no harm.
For locking in static methods some preprocessor macros are provided:
This class is thread-safe.
Definition at line 67 of file LOW_objectSynchronizer.h.
|
Constructor.
Definition at line 27 of file LOW_objectSynchronizer.cpp. References LOW_thread_Factory::new_rwlock(), objectSyncRwlock, and writeLockHolder. |
|
Copy constructor.
Definition at line 34 of file LOW_objectSynchronizer.cpp. References LOW_thread_Factory::new_rwlock(), objectSyncRwlock, and writeLockHolder. |
|
Destructor.
Definition at line 41 of file LOW_objectSynchronizer.cpp. References objectSyncRwlock. |
|
Definition at line 53 of file LOW_objectSynchronizer.cpp. References LOW_thread_Factory::new_rwlock(), and objectSyncRwlock. |
|
Definition at line 583 of file LOW_objectSynchronizer.h. |
|
Definition at line 585 of file LOW_objectSynchronizer.h. |
|
Definition at line 584 of file LOW_objectSynchronizer.h. |
|
Definition at line 586 of file LOW_objectSynchronizer.h. |
|
|