Rein Klazes rklazes@xs4all.nl writes:
I looked at many of these sequences. In all of them the subthread finished well before the main thread executed its Wait. I was looking for timing differences between the processing of the two threads, checking whether and when the WM_NULL message gets processed. Nothing seems to stand out.
Any suggestions how to debug this?
It's a bug in Agent, it is waiting on a handle that it has already closed. It works in most cases because the handle is simply invalid, but from time to time the handle has already been reused and the wait blocks. I guess if it never happens under Windows then it's probably because there's somewhere that we allocate a handle that Windows doesn't. You should look where the 0xcc handle got reallocated the last time.