Phoenix
Object-oriented orthogonally persistent operating system
Public Member Functions
SpinLock Class Reference

Spin lock synchronization primitive. More...

#include <md_lock.h>

List of all members.

Public Member Functions

void Lock ()
 Acquire lock.
void Unlock ()
 Release lock.
int TryLock ()
 Try to acquire lock.
 operator bool ()

Detailed Description

Spin lock synchronization primitive.

This primitive just stops code execution in a small loop until a lock is released.


Member Function Documentation

void SpinLock::Lock ( ) [inline]

Acquire lock.

SpinLock::operator bool ( ) [inline]
Returns:
Current state of the lock - true if locked, false if not locked.
int SpinLock::TryLock ( ) [inline]

Try to acquire lock.

This method will not block if the lock can not be acquired.

Returns:
0 if successfully locked, -1 otherwise.
void SpinLock::Unlock ( ) [inline]

Release lock.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines