SbThreadSignal Class Reference
[Threads]

VSG extension Portable signal class. More...

#include <Inventor/threads/SbThreadSignal.h>

List of all members.

Public Member Functions

 SbThreadSignal (SbThreadMutex *mtx)
 ~SbThreadSignal ()
void signalOne ()
void signalAll ()
void wait ()
SbBool trywait (const unsigned int timeout_ms)

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


Constructor & Destructor Documentation

SbThreadSignal::SbThreadSignal ( SbThreadMutex mtx  ) 

Constructor.

SbThreadSignal::~SbThreadSignal (  ) 

Destructor.


Member Function Documentation

void SbThreadSignal::signalAll (  ) 

Signals all threads that are waiting on this object.

void SbThreadSignal::signalOne (  ) 

Signals one thread that is waiting on this object.

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.

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:

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/