|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLMISC::CUnfairSynchronized Class Template ReferenceThis class ensure that the Value is accessed by only one thread.
More...
#include <mutex.h>
List of all members.
Detailed Description
template<class T>
class NLMISC::CUnfairSynchronized< T >
This class ensure that the Value is accessed by only one thread.
First you have to create a CSynchronized class with you type. Then, if a thread want to modify or do anything on it, you create a CAccessor in a sub scope. You can modify the value of the CUnfairSynchronized using the value function until the end of the scope. So you have to put the smaller scope as you can.
Internally, this class uses a CUnfairMutex object (see CUnfairMutex for programming considerations).
CUnfairSynchronized<int> val;
{
CUnfairSynchronized<int>::CAccessor acces(&val);
acces.value () = 10;
}
*
-
Author:
-
Vianney Lecroart , Nevrax France
-
Date:
-
2000
Definition at line 393 of file mutex.h.
Constructor & Destructor Documentation
template<class T> |
NLMISC::CUnfairSynchronized< T >::CUnfairSynchronized |
( |
const std::string & |
name |
) |
[inline] |
|
Friends And Related Function Documentation
template<class T> |
friend class CUnfairSynchronized::CAccessor [friend]
|
|
Member Data Documentation
template<class T> |
volatile CUnfairMutex NLMISC::CUnfairSynchronized::_Mutex [private]
|
|
template<class T> |
volatile T NLMISC::CUnfairSynchronized::_Value [private]
|
|
|
The synchronized value.
Definition at line 435 of file mutex.h. |
The documentation for this class was generated from the following file:
|
|