Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SbThreadSpinlock Class Reference

VSG extension Portable spinlock class. More...

#include <Inventor/threads/SbThreadSpinlock.h>

Public Member Functions

 SbThreadSpinlock ()
 Create a spinlock.
 
 ~SbThreadSpinlock ()
 Destructor.
 
void lock ()
 Request exclusive access for this spinlock.
 
void unlock ()
 Release exclusive access.
 

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

Definition at line 58 of file SbThreadSpinlock.h.

Constructor & Destructor Documentation

◆ SbThreadSpinlock()

SbThreadSpinlock::SbThreadSpinlock ( )

Create a spinlock.

◆ ~SbThreadSpinlock()

SbThreadSpinlock::~SbThreadSpinlock ( )

Destructor.

Member Function Documentation

◆ lock()

void SbThreadSpinlock::lock ( )

Request exclusive access for this spinlock.

◆ unlock()

void SbThreadSpinlock::unlock ( )

Release exclusive access.


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