Classes | Public Member Functions

Spin_Lock Class Reference

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

#include <Spin_Lock.h>

List of all members.

Classes

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

Public Member Functions

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

Detailed Description

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

MCPN Logo
kr0st © 2010