SbThreadAutoLock(3)
π SbThreadAutoLock π
okay bestie, welcome to SbThreadAutoLock(3), from the Library Functions Manual β¨ this one's a lil library function, and honestly? she's an icon, she's a queen, she does exactly one job and she does it flawlessly π
πΈ NAME πΈ
SbThreadAutoLock β a simple convenience class for locking access to a function. no cap, that's the whole vibe π
β¨ SYNOPSIS β¨
#include <Inventor/threads/SbThreadAutoLock.h>
π«Ά Public Member Functions
SbThreadAutoLock (SbMutex *mutexptr)~SbThreadAutoLock ()
π Protected Attributes
SbMutex * mutex
π¦ Detailed Description π¦
So. SbThreadAutoLock is a simple convenience class for locking access to a function. that's it, that's her resume π
She gives you a simple convenience mechanism for automatically locking access to a function that is not re-entrant. like, the function cannot handle being called by two threads at once, bestie, and she's here to make sure that never happens π§
Usage example, look at this gorgeousness:
void
myfunction(void)
{
SbThreadAutoLock lock(aMutexPtr);
// [other code]
}
Here's the magic, and I need you to be seated for this: in the class constructor, SbMutex::lock() is called on the mutex. and then β this is the convenience part, the main character part β when the function exits, the destructor will automatically be invoked, calling SbMutex::unlock() on the same mutex. no manual unlocking, no forgetting, no "oops I deadlocked the whole app" π she literally cleans up after herself. periodt π
π Constructor & Destructor Documentation π
π SbThreadAutoLock::SbThreadAutoLock (SbMutex * mutex) [inline]
The constructor calls SbMutex::lock() on mutex.
The constructor calls SbThreadMutex::lock() on mutex.
References SbMutex::lock(). β¨
π SbThreadAutoLock::~SbThreadAutoLock () [inline]
The destructor calls unlock() on the mutex passed in as a parameter to the constructor. it's giving responsible π
References SbMutex::unlock(). πΈ
π Author π
Generated automatically by Doxygen for Coin from the source code. (not a human, not a bestie, just a very diligent robot π«Ά)
okay that's the whole page!! and for the lil sign-off moment: this lil masterpiece lives in Coin, Version 2.5.0, and you'll find her filed under SbThreadAutoLock(3) in the manual. go lock something safely, bestie πππ¦
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms