lambda-kern icon indicating copy to clipboard operation
lambda-kern copied to clipboard

Utilize thread blocking in lock/unlock

Open farlepet opened this issue 3 years ago • 0 comments

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.

farlepet avatar Jun 26 '22 13:06 farlepet