Main MRPT website > C++ reference for MRPT 1.5.9
Classes | Namespaces | Macros
CCriticalSection.h File Reference
#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

◆ THREADSAFE_OPERATION

#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 123 of file CCriticalSection.h.




Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020