|
Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
|
#include <mutex.h>
Public Member Functions | |
| _Atomic (srn_fiber_t *) state | |
| A pointer to the waiter's stack head. | |
Data Fields | |
| srn_fiber_t * | waiters_head |
| A private (In the sense that it only touched only by the current lock holder during unlock) pointer to the head of the waiters in order. | |
| srn_fiber_mutex_t::_Atomic | ( | srn_fiber_t * | ) |
A pointer to the waiter's stack head.
nullptr == unlocked. Contending fibers push onto the stack lock free, and the holder drains it (it's basically a treiber stack). So having a waiter implies the lock is acquired by someone.
| srn_fiber_t* srn_fiber_mutex_t::waiters_head |
A private (In the sense that it only touched only by the current lock holder during unlock) pointer to the head of the waiters in order.
Since it is private it needs not to be atomic. The holder fills it in one reversed batch when it drains the incoming stack, then pops one fiber from its head per unlock. Threaded through srn_fiber_t.link.