docs/html/classMutex.html
| | Jetson Inference
DNN Vision Library |
Public Member Functions | Protected Attributes | List of all members
Mutex Class Reference Utilities Library (jetson-utils) » Multithreading
A lightweight mutual exclusion lock. More...
#include <Mutex.h>
|
|
| | Mutex () |
| | Constructor. More...
|
| |
| | ~Mutex () |
| | Destructor. More...
|
| |
| bool | AttemptLock () |
| | If the lock is free, aquire it. More...
|
| |
| void | Lock () |
| | Aquire the lock, whenever it becomes available. More...
|
| |
| void | Unlock () |
| | Release the lock. More...
|
| |
| void | Sync () |
| | Wait for the lock, then release it immediately. More...
|
| |
| pthread_mutex_t * | GetID () |
| | Get the mutex object. More...
|
| |
|
| | pthread_mutex_t | mID | | |
A lightweight mutual exclusion lock.
It is very fast to check if the mutex is available, lock it, and release it. However, if the mutex is unavailable when you attempt to lock it, execution of the thread will stop until it becomes available.
|
| Mutex::Mutex | ( | | ) | |
| inline |
Constructor.
|
| Mutex::~Mutex | ( | | ) | |
| inline |
Destructor.
|
| bool Mutex::AttemptLock | ( | | ) | |
| inline |
If the lock is free, aquire it.
Otherwise, return without waiting for it to become available.
ReturnsTrue if the lock was aquired, false if not.
|
| pthread_mutex_t* Mutex::GetID | ( | | ) | |
| inline |
Get the mutex object.
|
| void Mutex::Lock | ( | | ) | |
| inline |
Aquire the lock, whenever it becomes available.
This could mean just a few instructions if the lock is already free, or to block the thread if it isn't.
|
| void Mutex::Sync | ( | | ) | |
| inline |
Wait for the lock, then release it immediately.
Use this in situations where you are waiting for an event to occur.
|
| void Mutex::Unlock | ( | | ) | |
| inline |
Release the lock.
|
| pthread_mutex_t Mutex::mID |
| protected |
The documentation for this class was generated from the following file: