lambda-kern
lambda-kern copied to clipboard
Utilize thread blocking in lock/unlock
Initial thought involves converting lock_t to a structure, containing both the atomic variable, and a list of threads currently waiting for it to unlock. When it is unlocked, the first thread will be unblocked and removed from the list.
There may be a more efficient way to achieve this, however.
May also be useful to have both thread-aware and non-thread-aware variants.