concurrent-extra icon indicating copy to clipboard operation
concurrent-extra copied to clipboard

`RLock` may starve thread?

Open konsumlamm opened this issue 2 years ago • 0 comments

Control.Concurrent.RLock.acquire waits on the inner Lock and then tries to acquire the RLock again. However, what if between these two operations, another thread managed to acquire the RLock? The thread has to wait again, potentially forever. The doc comment says that the runtime guarantees that the woken thread completes its acquire operation, but I don't see how that can be achieved in this situation. Did I maybe miss something or is this a bug?

konsumlamm avatar Aug 16 '23 12:08 konsumlamm