An object to help coordinate read-write accesses to various shared objects within the Robolocust controller. More...
#include <Robots/LoBot/thread/LoUpdateLock.H>
Public Member Functions | |
~UpdateLock () | |
Clean-up. | |
void | read_lock () |
The locking functions. | |
void | write_lock () |
void | unlock () |
Static Public Member Functions | |
static void | begin_read () |
Convenience functions. | |
static void | end_read () |
static void | begin_write () |
static void | end_write () |
Friends | |
class | singleton< UpdateLock > |
An object to help coordinate read-write accesses to various shared objects within the Robolocust controller.
This class implements a reader-writer lock meant to be shared by the Robolocust controller's main thread and each of its behaviours. The main thread is responsible for updating the different sensors (laser range finder, cameras, etc.) and other objects (LGMD models, integration algorithm, etc.). The individual behaviours simply retrieve the latest values from these objects.
Each thread must take care of using this lock appropriately when required. That is, the objects themselves do not perform any locking (in other words, they are not thread-safe).
Definition at line 90 of file LoUpdateLock.H.
lobot::UpdateLock::~UpdateLock | ( | ) |
Clean-up.
Definition at line 110 of file LoUpdateLock.C.
static void lobot::UpdateLock::begin_read | ( | ) | [inline, static] |
Convenience functions.
Definition at line 114 of file LoUpdateLock.H.
void lobot::UpdateLock::read_lock | ( | ) |
The locking functions.
Definition at line 92 of file LoUpdateLock.C.