STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

thread_mutex Class Reference

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

#include <winstl_thread_mutex.h>

List of all members.

Public Methods

 thread_mutex () winstl_throw_0()
 Creates an instance of the mutex.

 thread_mutex (ws_dword_t spinCount) winstl_throw_0()
 Creates an instance of the mutex and sets its spin count.

 ~thread_mutex () winstl_throw_0()
 Destroys an instance of the mutex.

void lock () winstl_throw_0()
 Acquires a lock on the mutex, pending the thread until the lock is aquired.

bool try_lock ()
 Attempts to lock the mutex.

void unlock () winstl_throw_0()
 Releases an aquired lock on the mutex.

ws_dword_t set_spin_count (ws_dword_t spinCount) winstl_throw_0()
 Sets the spin count for the mutex.


Detailed Description

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


Constructor & Destructor Documentation

thread_mutex   [inline]
 

Creates an instance of the mutex.

thread_mutex ws_dword_t    spinCount [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   [inline]
 

Destroys an instance of the mutex.


Member Function Documentation

void lock   [inline]
 

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

ws_dword_t set_spin_count ws_dword_t    spinCount [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

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   [inline]
 

Releases an aquired lock on the mutex.


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

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004