FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxSpinLock Class Reference

#include <fbxsync.h>

Class Description

A spinlock is the fastest and most simple thread lock mechanism available.

It is very efficient since it does not use any operating system calls; it is only a test and set on an atomic variable, thus it is the fastest thread lock available. Spinlocks are efficient if threads are only likely to be blocked for a short period of time, as they avoid overhead from operating system process re-scheduling or context switching. However, spinlocks become wasteful if held for longer durations, both preventing other threads from running and requiring re-scheduling.

Note
Spinlocks does not support recursive locking. A thread attempting to lock the same spinlock twice will wait indefinitely.

Definition at line 38 of file fbxsync.h.

Public Member Functions

 FbxSpinLock ()
 
void Acquire ()
 Acquire the lock; thread will wait indefinitely until it is available. More...
 
void Release ()
 Release the lock; this will allow other threads to acquire the lock if they are waiting. More...
 

Constructor & Destructor Documentation

◆ FbxSpinLock()

Member Function Documentation

◆ Acquire()

void Acquire ( )

Acquire the lock; thread will wait indefinitely until it is available.

◆ Release()

void Release ( )

Release the lock; this will allow other threads to acquire the lock if they are waiting.


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