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  

process_mutex Class Reference

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

#include <winstl_process_mutex.h>

List of all members.

Public Methods

Construction
 process_mutex () winstl_throw_0()
 Creates an instance of the mutex.

 process_mutex (ws_char_a_t const *name) winstl_throw_0()
 Creates an instance of the mutex.

 process_mutex (ws_char_w_t const *name) winstl_throw_0()
 Creates an instance of the mutex.

 process_mutex (ws_bool_t bInitialOwer) winstl_throw_0()
 Creates an instance of the mutex.

 process_mutex (ws_char_a_t const *name, ws_bool_t bInitialOwer) winstl_throw_0()
 Creates an instance of the mutex.

 process_mutex (ws_char_w_t const *name, ws_bool_t bInitialOwer) winstl_throw_0()
 Creates an instance of the mutex.

 process_mutex (ws_char_a_t const *name, ws_bool_t bInitialOwer, LPSECURITY_ATTRIBUTES psa) winstl_throw_0()
 Creates an instance of the mutex.

 process_mutex (ws_char_w_t const *name, ws_bool_t bInitialOwer, LPSECURITY_ATTRIBUTES psa) winstl_throw_0()
 Creates an instance of the mutex.

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

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

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

ws_bool_t try_lock ()
 Attempts to lock the mutex.

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

Accessors
Attributes
ws_bool_t created () const
 Indicates whether this object instance created the underlying mutex object.

ws_bool_t abandoned () const
 Indicates whether a successful call to lock occurred because the underlying mutex was previously held by a thread that abandoned.


Detailed Description

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


Constructor & Destructor Documentation

process_mutex   [inline]
 

Creates an instance of the mutex.

process_mutex ws_char_a_t const *    name [inline, explicit]
 

Creates an instance of the mutex.

process_mutex ws_char_w_t const *    name [inline, explicit]
 

Creates an instance of the mutex.

process_mutex ws_bool_t    bInitialOwer [inline, explicit]
 

Creates an instance of the mutex.

process_mutex ws_char_a_t const *    name,
ws_bool_t    bInitialOwer
[inline, explicit]
 

Creates an instance of the mutex.

process_mutex ws_char_w_t const *    name,
ws_bool_t    bInitialOwer
[inline, explicit]
 

Creates an instance of the mutex.

process_mutex ws_char_a_t const *    name,
ws_bool_t    bInitialOwer,
LPSECURITY_ATTRIBUTES    psa
[inline, explicit]
 

Creates an instance of the mutex.

process_mutex ws_char_w_t const *    name,
ws_bool_t    bInitialOwer,
LPSECURITY_ATTRIBUTES    psa
[inline, explicit]
 

Creates an instance of the mutex.

~process_mutex   [inline]
 

Destroys an instance of the mutex.


Member Function Documentation

ws_bool_t abandoned   const [inline]
 

Indicates whether a successful call to lock occurred because the underlying mutex was previously held by a thread that abandoned.

Returns:
true The mutex object was abandoned by its previous owning thread false The mutex object was not abandoned by its previous owning thread
Note:
This attribute is meaningful with respect to the result of the last call to lock() or try_lock(). Subsequent calls to unlock() do not affect this attribute.

ws_bool_t created   const [inline]
 

Indicates whether this object instance created the underlying mutex object.

Returns:
true The mutex object was created by this instance false The mutex object was not created by this instance
Note:
For unnamed mutexes this will always be false

ws_bool_t lock ws_dword_t    wait [inline]
 

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

void lock   [inline]
 

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

ws_bool_t try_lock   [inline]
 

Attempts to lock the mutex.

Returns:
true if the mutex was aquired, or false if not

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