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::LockManager ( )

Constructor

Definition at line 26 of file LockManager.cc.

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

◆ ~LockManager()

LockManager::~LockManager ( )

Destructor

Definition at line 30 of file LockManager.cc.

Member Function Documentation

◆ acquired()

void LockManager::acquired ( Semaphore &  sem)

Called by Semaphore on successful acquisition.

Definition at line 32 of file LockManager.cc.

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

◆ released()

void LockManager::released ( Semaphore &  sem)

Called by Semaphore on successful release.

Definition at line 36 of file LockManager.cc.

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

Member Data Documentation

◆ m_Stack

Vector<Semaphore*> LockManager::m_Stack
private

The stack of acquired semaphores.

Definition at line 50 of file LockManager.h.

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


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