#include <switch_lock.h>
Public Member Functions | |
void | initialize () |
Initialize Switch_lock. | |
Context * | lock_owner () const |
Lock owner. | |
bool | test () const |
Is lock set?. | |
void | lock () |
Acquire the lock with priority inheritance. | |
bool | test_and_set () |
Acquire the lock with priority inheritance. | |
void | clear () |
Free the lock. | |
Private Member Functions | |
bool | try_lock () |
Try to acquire the lock. | |
Private Attributes | |
Context * | _lock_owner |
|
Free the lock. Return the CPU to helper if there is one, since it had to have a higher priority to be able to help (priority may be its own, it may run on a donated timeslice or round robin scheduling may have selected a thread on the same priority level as me) |
|
Initialize Switch_lock. Call this function if you cannot guarantee that your Switch_lock instance is allocated from zero-initialized memory. |
|
Acquire the lock with priority inheritance. If the lock is occupied, enqueue in list of helpers and lend CPU to current lock owner until we are the lock owner. |
|
Lock owner.
|
|
Is lock set?.
|
|
Acquire the lock with priority inheritance.
|
|
Try to acquire the lock.
|
|
|