Even though it's been a while:anovikov wrote: ↑Sun Oct 05, 2014 6:47 pmI have emailed you the RVThread implementation with the atomic, volatile read/write to thread status.Sergey Tkachenko wrote: So, do you use thirdparty components, or may be your own code uses Synchronize?
I also added the unit that fixes the synchronization deadlock universally. I inherited your RVThread from TSynchronizedThread and replaced CheckSynchronize by SyncOrAbort implemented in the TSynchronizedThread unit. Please note that TSynchronizedThread has its own Synchronize() method implementation so it uses a different mechanism to synchronize with the Main Thread that helps avoid the deadlock.
BTW I did not have time to fully test this new unit in your case (it just works for now and I have other things to do), but you might want to run different tests on to ensure this mechanism solves this problem without creating new issues.
You can go ahead and add this to your library if it works for you in the end as the fix.
The solution sounds relatively promising. Unfortunately, this has not been discussed here.
Since we have the same problem and are very interested in a solution, we would like to know whether the changes solve the problem.
Thank you in advance