Read/write locks and wait/wake on atomics: are there Julia futexes?

I wished there was a read-write lock in Julia but I couldn’t find any. But there are atomics so I figured I could write one myself, inspiring from this (inspiring) book on the nasty-gritty low-level details of concurrency.

Unfortunately, I can’t manage to get it right without the wait/wake functionalities provided by futexes or equivalent. By “right” I mean without potential deadlocks, and yet without busy-waiting and without sleeping.

Do these exist in julia? Or would I need to make my own system calls? Or is there already a read-write lock in the standard library that I’d have overlooked?

There is Base.Semaphore, which may help you here.