-
-
Save davedice/bb56f11ffe9f72710928 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Acquire(L) : | |
auto n = QNodeAllocate() | |
n->Locked = 1 | |
auto prv = swap (&L->Tail, n) | |
while prv->Locked != 0 : Pause | |
QnodeFree (prv) | |
L->Owner = n | |
Release(L) : | |
L->Owner->Locked = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment