SbThreadSpinlock Class Reference
[Threads]

VSG extension Portable spinlock class. More...

#include <Inventor/threads/SbThreadSpinlock.h>

List of all members.

Public Member Functions

 SbThreadSpinlock ()
 ~SbThreadSpinlock ()
void lock ()
void unlock ()

Detailed Description

VSG extension Portable spinlock class.

This class provides a portable "spinlock". It is implemented using the pthreads API on UNIX/Linux and the Win32 API on Microsoft Windows.

A spinlock can be used just like a mutex to protect access to critical data or code that is used by multiple threads. In some cases a spinlock may be more efficient than a mutex. But note that this class may be implemented using a mutex if there is no native support, which is currently the case on UNIX/Linux.

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

SbThread, SbThreadAutoLock, SbThreadBarrier, SbThreadMutex


Constructor & Destructor Documentation

SbThreadSpinlock::SbThreadSpinlock (  ) 

Create a spinlock.

SbThreadSpinlock::~SbThreadSpinlock (  ) 

Destructor.


Member Function Documentation

void SbThreadSpinlock::lock (  ) 

Request exclusive access for this spinlock.

void SbThreadSpinlock::unlock (  ) 

Release exclusive access.


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/