Skip to content

Instantly share code, notes, and snippets.

@prydin

prydin/lock.c

Created Dec 19, 2019
Embed
What would you like to do?
Locking pseudo code
int waiters = 0;
void acquireLock() {
if(atomicIncrement(waiters) == 0) {
rerurn;
}
callSlowAndPainfulLockingLogic();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.