The spinlock_priority_mutex is an advanced synchronization mechanism that enhances the traditional mutex by introducing a priority-based approach.
More...
#include <spinlock_priority_mutex_cpl.hpp>
The spinlock_priority_mutex is an advanced synchronization mechanism that enhances the traditional mutex by introducing a priority-based approach.
- Template Parameters
-
◆ lock() [1/2]
Try to acquire the unique ownership of the spinlock_priority_mutex, blocking the thread if the spinlock_priority_mutex was already owned or other threads are waiting with higher priority.
- Parameters
-
priority | used to set a priority for this thread to aquire the lock. |
void my_function(int prio) {
m.lock(prio);
}
The spinlock_priority_mutex is an advanced synchronization mechanism that enhances the traditional mu...
Definition spinlock_priority_mutex_cpl.hpp:31
◆ lock() [2/2]
Try to acquire the unique ownership of the spinlock_priority_mutex, blocking the thread if the spinlock_priority_mutex was already owned or other threads are waiting with higher priority.
- Parameters
-
priority | used to set a priority for this thread to aquire the lock. |
void my_function(int prio) {
m.lock(prio);
}
◆ try_lock()
Try to acquire the unique ownership of the spinlock_priority_mutex, if successful will return true, false otherwise.
- Parameters
-
priority | used to set a priority for this thread to aquire the lock. |
void my_function(int prio) {
m.try_lock(prio);
}
- Returns
- bool
◆ unlock() [1/2]
◆ unlock() [2/2]
The documentation for this class was generated from the following files: