Skip to content

Instantly share code, notes, and snippets.

@prydin
Created December 19, 2019 17:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save prydin/3cb75ecbe07fa2f5f166e419f69dd54a to your computer and use it in GitHub Desktop.
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