Open satunin opened 3 years ago
I think it is currently not possible to make shared holders count available publicly in the LockHandle (or as a separate return value), because this counter could change in any moment leaving a user of LockHandle with incorrect count number. Semaphore support should be added directly into the core of the library.
Semaphore could be implemented using mutex though. But it is up to you to make counter shared between multiple processes using some storage.
Hi. Can i use this library like a semaphore. For example Acquire() can return SharedHoldersCount, not only LockHandle