Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Helping_lock Class Reference

A wrapper for Switch_lock that works even when the threading system has not been intialized yet. More...

#include <helping_lock.h>

List of all members.

Public Member Functions

 Helping_lock ()
 Constructor.
bool test_and_set ()
 Acquire the lock with priority inheritance.
void lock ()
 Acquire the lock with priority inheritance.
bool test ()
 Is lock set?.
void clear ()
 Free the lock.
Contextlock_owner ()
 Lock owner.

Static Public Attributes

static bool threading_system_active = false
 Threading system activated.

Private Attributes

Switch_lock _switch_lock


Detailed Description

A wrapper for Switch_lock that works even when the threading system has not been intialized yet.

This wrapper is necessary because most lock-protected objects are initialized before the threading system has been fired up.


Constructor & Destructor Documentation

Helping_lock::Helping_lock  )  [inline]
 

Constructor.


Member Function Documentation

void Helping_lock::clear  )  [inline]
 

Free the lock.

Return the CPU to helper or next lock owner, whoever has the higher priority, given that thread's priority is higher that our's.

void Helping_lock::lock  )  [inline]
 

Acquire the lock with priority inheritance.

If the lock is occupied, enqueue in list of helpers and lend CPU to current lock owner until we are the lock owner.

Context * Helping_lock::lock_owner  )  [inline]
 

Lock owner.

Returns:
current owner of the lock. 0 if there is no owner.

bool Helping_lock::test  )  [inline]
 

Is lock set?.

Returns:
true if lock is set.

bool Helping_lock::test_and_set  ) 
 

Acquire the lock with priority inheritance.

Returns:
true if we owned the lock already. false otherwise.


Member Data Documentation

Switch_lock Helping_lock::_switch_lock [private]
 

bool Helping_lock::threading_system_active = false [static]
 

Threading system activated.


The documentation for this class was generated from the following files:
Generated on Mon Sep 26 14:20:14 2005 for Fiasco by  doxygen 1.4.2