# mutex Class Reference

`#include <_mutex_pthreads.h>`

Inheritance diagram for mutex:

List of all members.

## Public Member Functions

| mutex ()
| ~mutex ()
void | lock_mutex (void)
bool | try_lock_mutex (void)
void | unlock_mutex (void)
| mutex ()
| ~mutex ()
void | lock_mutex ()
void | unlock_mutex ()
| mutex ()
| ~mutex ()
void | lock_mutex (void)
bool | try_lock_mutex (void)
void | unlock_mutex (void)

## Private Attributes

pthread_mutex_t | mtx
pthread_t | locker
int | depth
HANDLE | handle

## Classes

class | lock
| Exception-safe mutex lock class. More...

## Detailed Description

======================================================================== Extended Template and Library Mutex Abstraction Class Implementation $Id$

Copyright (c) 2002 Robert B. Quattlebaum Jr. Copyright (c) 2008 Chris Moore

This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

=== N O T E S ===========================================================

This is an internal header file, included by other ETL headers. You should not attempt to use it directly.

=========================================================================

======================================================================== Extended Template and Library Mutex Abstraction Class Implementation $Id$

Copyright (c) 2002 Robert B. Quattlebaum Jr.

This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

=== N O T E S ===========================================================

This is an internal header file, included by other ETL headers. You should not attempt to use it directly.

=========================================================================

Definition at line 46 of file _mutex_pthreads.h.

## Constructor & Destructor Documentation

mutex::mutex | ( |  | ) | `[inline]`

Definition at line 53 of file _mutex_pthreads.h.

References depth, locker, and mtx.

mutex::~mutex | ( |  | ) | `[inline]`

Definition at line 69 of file _mutex_pthreads.h.

References mtx.

mutex::mutex | ( |  | ) | `[inline]`

Definition at line 45 of file _mutex_pthreads_simple.h.

References mtx, and NULL.

mutex::~mutex | ( |  | ) | `[inline]`

Definition at line 46 of file _mutex_pthreads_simple.h.

References mtx.

mutex::mutex | ( |  | ) | `[inline]`

Definition at line 50 of file _mutex_win32.h.

References NULL.

mutex::~mutex | ( |  | ) | `[inline]`

Definition at line 53 of file _mutex_win32.h.

## Member Function Documentation

void mutex::lock_mutex | ( | void |  | ) | `[inline]`

Definition at line 83 of file _mutex_pthreads.h.

References depth, locker, and mtx.

Referenced by mutex::lock::lock().

bool mutex::try_lock_mutex | ( | void |  | ) | `[inline]`

Definition at line 95 of file _mutex_pthreads.h.

References mtx.

void mutex::unlock_mutex | ( | void |  | ) | `[inline]`

Definition at line 98 of file _mutex_pthreads.h.

References depth, locker, and mtx.

Referenced by mutex::lock::~lock().

void mutex::lock_mutex | ( | void |  | ) | `[inline]`

Definition at line 47 of file _mutex_pthreads_simple.h.

References mtx.

void mutex::unlock_mutex | ( | void |  | ) | `[inline]`

Definition at line 48 of file _mutex_pthreads_simple.h.

References mtx.

void mutex::lock_mutex | ( | void |  | ) | `[inline]`

Definition at line 66 of file _mutex_win32.h.

bool mutex::try_lock_mutex | ( | void |  | ) | `[inline]`

Definition at line 69 of file _mutex_win32.h.

void mutex::unlock_mutex | ( | void |  | ) | `[inline]`

Definition at line 72 of file _mutex_win32.h.

## Member Data Documentation

pthread_mutex_t mutex::mtx `[private]`

Definition at line 48 of file _mutex_pthreads.h.

Referenced by lock_mutex(), mutex(), try_lock_mutex(), unlock_mutex(), and ~mutex().

pthread_t mutex::locker `[private]`

Definition at line 49 of file _mutex_pthreads.h.

Referenced by lock_mutex(), mutex(), and unlock_mutex().

int mutex::depth `[private]`

Definition at line 50 of file _mutex_pthreads.h.

Referenced by lock_mutex(), mutex(), and unlock_mutex().

HANDLE mutex::handle `[private]`

Definition at line 47 of file _mutex_win32.h.

The documentation for this class was generated from the following files:

- _mutex_pthreads.h
- _mutex_pthreads_simple.h
- _mutex_win32.h