Semaphores in Plan 9

https://swtch.com/semaphore.pdf