OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::Semaphore Class Reference

Implements a semaphore. More...

#include <OgreSemaphore.h>

Public Member Functions

 Semaphore (uint32_t intialCount)
 
 ~Semaphore ()
 
bool decrementOrWait ()
 Decrements the semaphore by 1. More...
 
bool increment ()
 Increments the semaphore by 1. More...
 
bool increment (uint32_t value)
 Increments the semaphore by the given value. More...
 

Detailed Description

Implements a semaphore.

Constructor & Destructor Documentation

◆ Semaphore()

Ogre::Semaphore::Semaphore ( uint32_t  intialCount)

◆ ~Semaphore()

Ogre::Semaphore::~Semaphore ( )

Member Function Documentation

◆ decrementOrWait()

bool Ogre::Semaphore::decrementOrWait ( )

Decrements the semaphore by 1.

If the value would reach -1, it blocks the thread and clamps it to 0

On error returns false, true if everything's ok.

◆ increment() [1/2]

bool Ogre::Semaphore::increment ( )

Increments the semaphore by 1.

May wake up a thread stalled on decrement()

On error returns false, true if everything's ok.

Referenced by Ogre::ParallelHlmsCompileQueue::pushRequest().

◆ increment() [2/2]

bool Ogre::Semaphore::increment ( uint32_t  value)

Increments the semaphore by the given value.


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