Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Types | Private Member Functions | Private Attributes
jafar::kernel::FifoMutex Class Reference

This class implements a mutex with FIFO scheduling policy, based on boost mutexes and semaphores. More...


Detailed Description

This class implements a mutex with FIFO scheduling policy, based on boost mutexes and semaphores.

When the mutex is unlocked, the thread that takes the mutex is the first one that tried to lock it.

Definition at line 22 of file threads.hpp.

#include <threads.hpp>

Inheritance diagram for jafar::kernel::FifoMutex:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void lock ()
bool try_lock ()
void unlock ()
bool own_lock ()

Private Types

typedef std::pair
< boost::semaphore *, bool > 
SemWait
typedef std::pair
< boost::thread::id, SemWait > 
SemThread
typedef std::map
< boost::thread::id, SemWait > 
SemsMap
typedef std::list
< SemsMap::iterator > 
SemsList

Private Member Functions

bool lock_ (bool try_)

Private Attributes

boost::mutex m
SemsMap allSems
SemsList waitingSems
boost::optional
< SemsMap::iterator > 
computingSem

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:40 for Jafar by doxygen 1.7.6.1
LAAS-CNRS