Main MRPT website > C++ reference for MRPT 1.5.6
Classes | Namespaces | Macros
CCriticalSection.h File Reference
#include <mrpt/utils/CReferencedMemBlock.h>
#include <mrpt/utils/mrpt_macros.h>
#include <string>
Include dependency graph for CCriticalSection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mrpt::synch::CAbstractMutex
 
class  mrpt::synch::CCriticalSection
 This class provides simple critical sections functionality. More...
 
class  mrpt::synch::CCriticalSectionRecursive
 Recursive mutex: allow recursive locks by the owner thread. More...
 
class  mrpt::synch::CCriticalSectionLocker
 A class acquiring a CCriticalSection at its constructor, and releasing it at destructor. More...
 

Namespaces

 mrpt
 This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
 
 mrpt::utils
 Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
 
 mrpt::synch
 This namespace provides multitask, synchronization utilities.
 

Macros

#define THREADSAFE_OPERATION(_CRITSECT_OBJ, CODE_TO_EXECUTE)
 A macro for protecting a given piece of code with a critical section; for example: More...
 

Macro Definition Documentation

#define THREADSAFE_OPERATION (   _CRITSECT_OBJ,
  CODE_TO_EXECUTE 
)
Value:
{ \
mrpt::synch::CCriticalSectionLocker lock(&_CRITSECT_OBJ); \
CODE_TO_EXECUTE \
}

A macro for protecting a given piece of code with a critical section; for example:

CCriticalSection cs;
MyObject obj;
...
THREADSAFE_OPERATION(cs, obj.foo(); )
...
THREADSAFE_OPERATION(cs, obj.foo(); obj.bar(); }
See Also
CCriticalSectionLocker, CThreadSafeVariable

Definition at line 124 of file CCriticalSection.h.




Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018