Skip to content

Instantly share code, notes, and snippets.

@theleancoder
Created November 6, 2015 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theleancoder/d7dd12ed07ff93f7383c to your computer and use it in GitHub Desktop.
Save theleancoder/d7dd12ed07ff93f7383c to your computer and use it in GitHub Desktop.
acquire() {
while (!available)
/* schedule another process */
available = false
}
do {
acquire lock
critical section
release lock
remainder section
} while (true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment