Loki  0.1.7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Modules
LevelMutex.h File Reference

Defines classes and functions for LevelMutex facility. More...

#include <vector>
#include <assert.h>
#include <time.h>
#include <pthread.h>
#include <unistd.h>
Include dependency graph for LevelMutex.h:
This graph shows which files directly or indirectly include this file:

Classes

class  Loki::LevelMutexInfo
 
class  Loki::LevelMutexInfo::Checker
 
class  Loki::LevelMutexInfo::MutexUndoer
 
class  Loki::ThrowOnAnyMutexError
 
class  Loki::ThrowOnBadDesignMutexError
 
class  Loki::AssertAnyMutexError
 
class  Loki::AssertBadDesignMutexError
 
class  Loki::JustReturnMutexError
 
class  Loki::NoMutexWait
 
class  Loki::MutexSleepWaits
 
class  Loki::SpinLevelMutex
 
class  Loki::SleepLevelMutex
 
class  Loki::LevelMutex< MutexPolicy, DefaultLevel, ErrorPolicy, WaitPolicy >
 
class  Loki::MutexException
 
class  Loki::MutexLocker
 
class  Loki::MultiMutexLocker
 

Namespaces

 Loki
 

Macros

#define LOKI_THREAD_LOCAL   thread_local
 

Functions

unsigned int Loki::GetCurrentThreadsLevel (void)
 
unsigned int Loki::CountMutexesInCurrentThread (void)
 
unsigned int Loki::CountLocksInCurrentThread (void)
 
unsigned int Loki::CountMutexesAtCurrentLevel (void)
 
MutexErrors::Type Loki::DoMutexesMatchContainer (const LevelMutexInfo::MutexContainer &mutexes)
 

Detailed Description

Defines classes and functions for LevelMutex facility.

Macro Definition Documentation

#define LOKI_THREAD_LOCAL   thread_local
thread_local Keyword
The mutexes require compilers to provide thread local storage - meaning each thread gets its own copy of the data. The next version of C++ will have a new keyword, thread_local for that purpose. Some existing compilers already provide thread local storage using different syntax, so these lines use thread_local to mimic that syntax. If your compiler provides thread local storage but using different syntax besides "thread_local", you may want to modify these lines. If your compiler does not support thread local storage, you can't use LevelMutex.