From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/a03630.html | 185 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 docs/doxygen/nel/a03630.html (limited to 'docs/doxygen/nel/a03630.html') diff --git a/docs/doxygen/nel/a03630.html b/docs/doxygen/nel/a03630.html new file mode 100644 index 00000000..2b361bd9 --- /dev/null +++ b/docs/doxygen/nel/a03630.html @@ -0,0 +1,185 @@ + + +NeL: TemplateNLMISC::CUnfairSynchronized< T > class Reference + + + +
+

NLMISC::CUnfairSynchronized< T > Class Template Reference

#include <mutex.h> +

+


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).

+

// 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 + * +
Author:
Vianney Lecroart

+Nevrax France

+
Date:
2000
+ +

+ +

+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
+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + + + + + +
+template<class T>
NLMISC::CUnfairSynchronized< T >::CUnfairSynchronized const std::string &  name  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 591 of file mutex.h. +

+

00591 : _Mutex(name) { }
+
+


Friends And Related Function Documentation

+

+ + + + +
+ + + + + +
+template<class T>
friend class CUnfairSynchronized::CAccessor [friend] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 623 of file mutex.h.

+


Field Documentation

+

+ + + + +
+ + + + + +
+template<class T>
volatile CUnfairMutex NLMISC::CUnfairSynchronized< T >::_Mutex [private] +
+
+ + + + + +
+   + + +

+The mutex of the synchronized value. +

+ +

+Definition at line 626 of file mutex.h.

+

+ + + + +
+ + + + + +
+template<class T>
volatile T NLMISC::CUnfairSynchronized< T >::_Value [private] +
+
+ + + + + +
+   + + +

+The synchronized value. +

+ +

+Definition at line 629 of file mutex.h.

+


The documentation for this class was generated from the following file: +
Generated on Tue Mar 16 13:39:21 2004 for NeL by + +doxygen +1.3.6
+ + -- cgit v1.2.1