-
Problem report
-
Resolution: Fixed
-
Trivial
-
4.0.2, 4.2.0alpha1, 4.2 (plan)
-
None
-
Sprint 46, Nov 2018, Sprint 47, Dec 2018
-
2
This ticket is created due to comment
Current suspicion is that handle leak happen when thread is killed by timeout while handle is still open. It should be considered to terminate thread differently as per windows documented better solution:
The TerminateThread and TerminateProcess functions should be used only in extreme circumstances, since they do not allow threads to clean up, do not notify attached DLLs, and do not free the initial stack. In addition, handles to objects owned by the thread are not closed until the process terminates. The following steps provide a better solution:
Create an event object using the CreateEvent function.
Create the threads.
Each thread monitors the event state by calling the WaitForSingleObject function. Use a wait time-out interval of zero.
Each thread terminates its own execution when the event is set to the signaled state (WaitForSingleObject returns WAIT_OBJECT_0).