NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Semaphore Class Reference

A user semaphore optimized for the case where we do not block. More...

#include <semaphore.h>

Public Member Functions

 Semaphore (unsigned cap_sm=0, bool create=false)
void down ()
void up ()
unsigned sm ()

Private Attributes

KernelSemaphore _sem
long _value

Detailed Description

A user semaphore optimized for the case where we do not block.

This semaphore implementation breaks when threads blocking on the associated kernel semaphore can be canceled, because the kernel semaphore and the shared counter might then be out-of-sync.

Constructor & Destructor Documentation

Semaphore::Semaphore ( unsigned  cap_sm = 0,
bool  create = false 
)
inline

Member Function Documentation

void Semaphore::down ( )
inline
unsigned Semaphore::sm ( )
inline
void Semaphore::up ( )
inline

Member Data Documentation

KernelSemaphore Semaphore::_sem
private
long Semaphore::_value
private

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