thread_mutex Class Reference
[Synchronisation Library]

#include <winstl/synch/thread_mutex.hpp>

Inheritance diagram for thread_mutex:

critical_section< STLSOFT_CRITICAL_SECTION_IS_RECURSIVE, STLSOFT_CRITICAL_SECTION_IS_TRYABLE > critical_section_tag

List of all members.


Detailed Description

This class provides an implementation of the mutex model based on the Win32 CRITICAL_SECTION.

Public Types

typedef thread_mutex class_type
 This type.

Public Member Functions

 thread_mutex () throw ()
 Creates an instance of the mutex.
 thread_mutex (ws_dword_t spinCount) throw ()
 Creates an instance of the mutex and sets its spin count.
 ~thread_mutex () throw ()
 Destroys an instance of the mutex.
void lock () throw ()
 Acquires a lock on the mutex, pending the thread until the lock is aquired.
bool try_lock ()
 Attempts to lock the mutex.
void unlock () throw ()
 Releases an aquired lock on the mutex.
ws_dword_t set_spin_count (ws_dword_t spinCount) throw ()
 Sets the spin count for the mutex.

Member Typedef Documentation

This type.


Constructor & Destructor Documentation

thread_mutex (  )  throw () [inline]

Creates an instance of the mutex.

thread_mutex ( ws_dword_t  spinCount  )  throw () [inline]

Creates an instance of the mutex and sets its spin count.

Parameters:
spinCount The new spin count for the mutex
Note:
Only available with Windows NT 4 SP3 and later

~thread_mutex (  )  throw () [inline]

Destroys an instance of the mutex.


Member Function Documentation

void lock (  )  throw () [inline]

Acquires a lock on the mutex, pending the thread until the lock is aquired.

bool try_lock (  )  [inline]

Attempts to lock the mutex.

Returns:
true if the mutex was aquired, or false if not
Note:
Only available with Windows NT 4 and later

void unlock (  )  throw () [inline]

Releases an aquired lock on the mutex.

ws_dword_t set_spin_count ( ws_dword_t  spinCount  )  throw () [inline]

Sets the spin count for the mutex.

Parameters:
spinCount The new spin count for the mutex
Returns:
The previous spin count associated with the mutex
Note:
Only available with Windows NT 4 SP3 and later


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

Generated on Thu Jun 10 08:59:37 2010 for STLSoft by  doxygen 1.5.6