Main MRPT website > C++ reference
MRPT logo
Classes | Namespaces | Defines

CCriticalSection.h File Reference

#include <mrpt/utils/utils_defs.h>
#include <mrpt/utils/CStream.h>
#include <mrpt/utils/CReferencedMemBlock.h>
#include <mrpt/utils/CReferencedMemBlock.h>
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::CCriticalSection
 This class provides simple critical sections functionality. More...
class  mrpt::synch::CCriticalSectionLocker
 A class acquiring a CCriticalSection at its constructor, and releasing it at destructor. More...

Namespaces

namespace  mrpt
 

This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.


namespace  mrpt::synch
 

This namespace provides multitask, synchronization utilities.


Defines

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

Define 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 133 of file CCriticalSection.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011