fast_mutex.h File Reference

A fast mutex implementation for POSIX and Win32. More...

#include "_nvwa.h"
#include "c++11.h"
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
Include dependency graph for fast_mutex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  nvwa::fast_mutex
 Class for non-reentrant fast mutexes. More...
class  nvwa::fast_mutex_autolock
 An acquistion-on-initialization lock class based on fast_mutex. More...

Namespaces

namespace  nvwa

Defines

#define NVWA_USE_CXX11_MUTEX   0
#define _FAST_MUTEX_CHECK_INITIALIZATION   1
 Macro to control whether to check for initialization status for each lock/unlock operation.
#define _FAST_MUTEX_ASSERT(_Expr, _Msg)
 Macro for fast_mutex assertions.
#define __VOLATILE   volatile
 Macro alias to `volatile' semantics.

Detailed Description

A fast mutex implementation for POSIX and Win32.

Date:
2013-08-02

Define Documentation

#define __VOLATILE   volatile

Macro alias to `volatile' semantics.

Here it is truly volatile since it is in a multi-threaded (POSIX threads) environment.

#define _FAST_MUTEX_ASSERT ( _Expr,
_Msg   ) 
Value:
if (!(_Expr)) { \
            fprintf(stderr, "fast_mutex::%s\n", _Msg); \
            abort(); \
        }

Macro for fast_mutex assertions.

Real version (for debug mode).

#define _FAST_MUTEX_CHECK_INITIALIZATION   1

Macro to control whether to check for initialization status for each lock/unlock operation.

Defining it to a non-zero value will enable the check, so that the construction/destruction of a static object using a static fast_mutex not yet constructed or already destroyed will work (with lock/unlock operations ignored). Defining it to zero will disable to check.

#define NVWA_USE_CXX11_MUTEX   0
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines

Generated by  doxygen 1.6.2