Unlock from wrong thread

Hi there,

when unlocking a ReentrantLock from a different thread than the one that acquired the latch in the first place, julia raises the exception “unlock from wrong thread”. As the latch is associated to a resource, the logic of my application might pass the resource round different threads and, therefore, unlock its related latch from other threads.

Question is how to get round this limitation of ReentrantLock?

You could try using a Threads.SpinLock instead.