mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 23:33:20 +08:00
Some L0 debug CTSs intentionnally written to exit w/o proper resource clenup, f.e do not call zetDebugDetach() etc. On windows it could be the situation when cleanup of DebugSession is called in context of DllMain(DLL_PROCESS_DETACH). At this point all threads other then main already terminated by Windows, see remarks for DLL_PROCESS_DETACH in https://learn.microsoft.com/en-us/windows/win32/dlls/dllmain In this case worker thread object still exists, handle and Id are not null but corresponding Windows thread does not exist any more and application waits forever for threadFinished variable. We can safely omit this waiting since join() will either return immediately in case of thread was killed by Windows or wait until thread is terminated in normal way. Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>