If you can read this text, it means you are not experiencing this website at its best. This website is designed for used with a standards-compliant browser.
Current version: 2.3.1
ZThreads
A platform-independent, multi-threading and synchronization library for C++
Home Documentation Downloads CVS Contact

# PrioritySemaphore Class Reference

`#include <PrioritySemaphore.h>`

Inheritance diagram for PrioritySemaphore:

List of all members.

## Public Member Functions
| PrioritySemaphore (int count=1, unsigned int maxCount=1)
virtual | ~PrioritySemaphore ()
void | wait ()
bool | tryWait (unsigned long)
void | post ()
virtual int | count ()
virtual bool | tryAcquire (unsigned long timeout)
virtual void | acquire ()
virtual void | release ()

## Detailed Description

Author:
  Eric Crahen <http://www.code-foo.com>

Date:
  <2003-07-16T15:36:07-0400>

Version:
  2.2.1

A PrioritySemaphore operates in the same way as a Semaphore. Its an owner-less Lockable object that is sensitive to priority.

Scheduling

Threads blocked on a PrioritySemaphore are resumed in priority order, highest priority first.

Error Checking

An attempt to increase a PrioritySemaphore beyond its maximum value will result in an InvalidOp_Exception.

See also:
  Semaphore

## Constructor & Destructor Documentation

PrioritySemaphore | ( | int | count = 1,
|  | unsigned int | maxCount = 1
| ) |

| See also: Semaphore::Semaphore(int count, unsigned int maxCount)

virtual ~PrioritySemaphore | ( |  | ) | `[virtual]`

| See also: Semaphore::~Semaphore()

## Member Function Documentation

virtual void acquire | ( |  | ) | `[virtual]`

| See also: Semaphore::acquire() Implements Lockable.

virtual int count | ( |  | ) | `[virtual]`

| See also: Semaphore::count()

void post | ( |  | ) |

| See also: Semaphore::post()

virtual void release | ( |  | ) | `[virtual]`

| See also: Semaphore::release() Implements Lockable.

virtual bool tryAcquire | ( | unsigned long | timeout | ) | `[virtual]`

| See also: Semaphore::tryAcquire(unsigned long timeout) Implements Lockable.

bool tryWait | ( | unsigned | long | ) |

| See also: Semaphore::tryWait(unsigned long)

void wait | ( |  | ) |

| See also: Semaphore::wait()

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

- PrioritySemaphore.h