gabr42 / OmniThreadLibrary

A simple and powerful multithreading library for Delphi
http://www.omnithreadlibrary.com
Other
462 stars 141 forks source link

Locked<T>.GetValue assertion failure #109

Closed VyPu closed 6 years ago

VyPu commented 6 years ago

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.

gabr42 commented 6 years ago

This was fixed in 3.07.5