The Pedigree Project  0.1
Public Member Functions | Private Attributes | List of all members
LockManager Class Reference

#include <LockManager.h>

+ Collaboration diagram for LockManager:

Public Member Functions

 LockManager ()
 
 ~LockManager ()
 
void acquired (Semaphore &sem)
 
void released (Semaphore &sem)
 

Private Attributes

Vector< Semaphore * > m_Stack
 

Detailed Description

A class for managing locks. It is only used if ENFORCE_LOCK_ORDERING is defined, and expects Semaphores to notify it of acquisition and release. If a semaphore is released before one which was acquired after it, an assertion fires.

It is expected to have one LockManager per processor.

Definition at line 35 of file LockManager.h.

Constructor & Destructor Documentation

LockManager::LockManager ( )

Constructor

Definition at line 26 of file LockManager.cc.

References Vector< T >::clear(), and m_Stack.

LockManager::~LockManager ( )

Destructor

Definition at line 31 of file LockManager.cc.

Member Function Documentation

void LockManager::acquired ( Semaphore sem)

Called by Semaphore on successful acquisition.

Definition at line 35 of file LockManager.cc.

References m_Stack, and Vector< T >::pushBack().

void LockManager::released ( Semaphore sem)

Called by Semaphore on successful release.

Definition at line 40 of file LockManager.cc.

References FATAL, m_Stack, Vector< T >::popBack(), and Vector< T >::pushBack().

Member Data Documentation

Vector<Semaphore *> LockManager::m_Stack
private

The stack of acquired semaphores.

Definition at line 51 of file LockManager.h.

Referenced by acquired(), LockManager(), and released().


The documentation for this class was generated from the following files: