#include <mutex.h>
Internally, this class uses a CUnfairMutex object (see CUnfairMutex for programming considerations).
// the value that you want to be thread safe. CUnfairSynchronized<int> val; { // create a new scope for the access // get an access to the value CUnfairSynchronized<int>::CAccessor acces(&val); // now, you have a thread safe access until the end of the scope, so you can do whatever you want. for example, change the value acces.value () = 10; } // end of the access *
Nevrax France
Definition at line 587 of file mutex.h.
Public Member Functions | |
| CUnfairSynchronized (const std::string &name) | |
Private Attributes | |
| volatile CUnfairMutex | _Mutex |
| The mutex of the synchronized value. | |
| volatile T | _Value |
| The synchronized value. | |
Friends | |
| class | CUnfairSynchronized::CAccessor |
|
||||||||||
|
Definition at line 591 of file mutex.h.
00591 : _Mutex(name) { } |
|
|||||
|
|
|
|||||
|
The mutex of the synchronized value.
|
|
|||||
|
The synchronized value.
|
1.3.6