Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SbThreadSignal Class Reference

VSG extension Portable signal class. More...

#include <Inventor/threads/SbThreadSignal.h>

Public Member Functions

 SbThreadSignal (SbThreadMutex *mtx)
 Constructor.
 
 ~SbThreadSignal ()
 Destructor.
 
void signalOne ()
 Signals one thread that is waiting on this object.
 
void signalAll ()
 Signals all threads that are waiting on this object.
 
void wait ()
 Waits for a signal notification.
 
SbBool trywait (const unsigned int timeout_ms)
 Waits for a signal notification or timeout milliseconds have elapsed.
 

Detailed Description

VSG extension Portable signal class.

This class provides a portable "condition variable" object. Condition variables are used when one thread wants to wait until another thread has finished doing something: the first thread "waits" on the condition variable, the second thread "signals" the condition variable when it is done. It is implemented using the pthreads API on UNIX/Linux and the Win32 API on Microsoft Windows.

It is not necessary to use this class in order to use multiple threads with Open Inventor. It is provided only as a convenience. However, note that you should use pthreads on UNIX/Linux and Win32 on Windows to be certain of compatibility with Open Inventor.

SEE ALSO

SbThreadAutoLock, SbThreadBarrier, SbThreadMutex, SbThreadRWMutex

Definition at line 64 of file SbThreadSignal.h.

Constructor & Destructor Documentation

◆ SbThreadSignal()

SbThreadSignal::SbThreadSignal ( SbThreadMutex mtx)

Constructor.

◆ ~SbThreadSignal()

SbThreadSignal::~SbThreadSignal ( )

Destructor.

Member Function Documentation

◆ signalAll()

void SbThreadSignal::signalAll ( )

Signals all threads that are waiting on this object.

◆ signalOne()

void SbThreadSignal::signalOne ( )

Signals one thread that is waiting on this object.

◆ trywait()

SbBool SbThreadSignal::trywait ( const unsigned int  timeout_ms)

Waits for a signal notification or timeout milliseconds have elapsed.

If the timeout elapses before the signal is notified, the function returns FALSE to the caller, signifying that a timeout has occurred.

◆ wait()

void SbThreadSignal::wait ( )

Waits for a signal notification.

When called, it goes to sleep awaiting a subsequent notification from another thread (via the signalOne or signalAll methods).


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