Classes | Public Member Functions

Spin_Mutex Class Reference

A synchronization primitive for multithreaded applications. Multiple Get() method calls from one process will not lead to deadlock, in other words the Spin_Mutex is reentrant. Thread will not suspend waiting for resource but will "spin". More...

#include <Spin_Mutex.h>

Collaboration diagram for Spin_Mutex:
Collaboration graph
[legend]

List of all members.

Classes

class  Scoped_Lock
 Spin_Mutex object is acquired on Scoped_Lock construction and released on destruction. More...

Public Member Functions

void Get (unsigned int PNumber=GetCurrentThreadId())
 Gets the Spin_Mutex. If it is not free then waits (blocking) and either gets the mutex or waits forever.
bool TryGet (unsigned int PNumber=GetCurrentThreadId())
 Tries getting the lock, returns "false" when mutex is already locked and "true" otherwise.
void Release (unsigned int PNumber=GetCurrentThreadId())
 Releases the Spin_Mutex allowing other threads to access the protected resource.

Detailed Description

A synchronization primitive for multithreaded applications. Multiple Get() method calls from one process will not lead to deadlock, in other words the Spin_Mutex is reentrant. Thread will not suspend waiting for resource but will "spin".

MCPN Logo
kr0st © 2010