I noticed that Locked<T>.GetValue sometimes raises assertion failure, when used in my application, where the Locked<T> structure is accessed from several threads. After examining the code I found the problem in TOmniCriticalSection.Release, where the ocsLockCount was decremented after releasing the critical section. Changing the sequence of those two lines fixes the problem. I made a pull request with a fix.
I noticed that
Locked<T>.GetValue
sometimes raises assertion failure, when used in my application, where theLocked<T>
structure is accessed from several threads. After examining the code I found the problem inTOmniCriticalSection.Release
, where theocsLockCount
was decremented after releasing the critical section. Changing the sequence of those two lines fixes the problem. I made a pull request with a fix.