SbMutex(3) Coin SbMutex(3)NAME
SbMutex -
A basic class for managing a mutex.
This class provides a portable framework around the mutex interface of the underlying native thread-handling toolkit.
SYNOPSIS
#include <Inventor/threads/SbMutex.h>
Public Member Functions
SbMutex (void)
~SbMutex ()
int lock (void)
SbBool tryLock (void)
int unlock (void)
Detailed Description
A basic class for managing a mutex.
This class provides a portable framework around the mutex interface of the underlying native thread-handling toolkit.
Constructor & Destructor Documentation
SbMutex::SbMutex (void) [inline]
Constructor.
SbMutex::~SbMutex () [inline]
Destructor.
Member Function Documentation
int SbMutex::lock (void) [inline]
This method locks the mutex. 0 is returned on success.
If the mutex was previously unlocked, the thread will lock the mutex and continue running. If the mutex was already locked when this call
is made, the thread will be suspended until the other thread holding the mutex releases it.
This is a blocking operation.
SbBool SbMutex::tryLock (void) [inline]
This method tries to lock the mutex, and returns whether it was locked or not. This is a non-blocking operation.
int SbMutex::unlock (void) [inline]
This method unlocks the mutex.
Author
Generated automatically by Doxygen for Coin from the source code.
Version 3.1.3 Wed May 23 2012 SbMutex(3)
Check Out this Related Man Page
Portable Threads Abstraction Classes(3) Coin Portable Threads Abstraction Classes(3)NAME
Portable Threads Abstraction Classes -
Classes
class SbBarrier
The SbBarrier class implements the 'barrier' multi-thread synchronization technique.
A barrier is a synchronization mechanism that is used for blocking threads as they enter the barrier until a given number of threads are
blocked, at which point all the threads are released again. "
class SbCondVar
A class for synchronizing access to global variables.
Condition variables are used to protect global variables in an environment where multiple threads are running concurrently. "
class SbFifo
A class for managing a pointer first-in, first-out queue.
class SbMutex
A basic class for managing a mutex.
This class provides a portable framework around the mutex interface of the underlying native thread-handling toolkit. "
class SbThreadAutoLock
Simple convenience class for locking access to a function.
This class provides a simple convenience mechanism for automatically locking access to a function that is not re-entrant. "
class SbRWMutex
class SbStorage
The SbStorage class manages thread-local memory.
This class manages thread-local memory. When different threads access the memory an SbStorage object manages, they will receive different
memory blocks back. "
class SbTypedStorage< Type >
The SbTypedStorage class manages generic thread-local memory.
This class manages thread-local memory. When different threads access the memory an SbTypedStorage object manages, they will receive
different memory blocks back. "
class SbThread
A class for managing threads.
This class provides a portable framework around the tasks of instantiating, starting, stopping and joining threads. "
Detailed Description
Coin implements a set of abstractions over the native threads data types that can be portably used across all the platforms Coin has been
ported to.
Author
Generated automatically by Doxygen for Coin from the source code.
Version 3.1.3 Wed May 23 2012 Portable Threads Abstraction Classes(3)
Hi all,
I have a scenario where I need to use the mutex locks. The mutex locks are working fine, but sometimes I am getting into the dead lock situation.
Below is the summary of my code :
MUTEX LOCK
performTask();
MUTEX UNLOCK.
In some cases I get into the situation where... (2 Replies)
Discussion started by: cjjoy
2 Replies
2. Post Here to Contact Site Administrators and Moderators
Hi,
Suppose I have a function that accesses and increments a global variable . This function is run as part of thread. One locks mutex in the function and unlocks it after the processing is done. Is there any alternative way? Thanks in advance. (1 Reply)