소스 검색

* Wake main thread when a thread is auto freed

Michaël Van Canneyt 3 달 전
부모
커밋
fc43e66f05
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      rtl/wasicommon/tthread.inc

+ 3 - 0
rtl/wasicommon/tthread.inc

@@ -184,6 +184,9 @@ begin
         Resume;
         end;
       {$IFDEF DEBUGWASMTHREADS}DebugWriteln('TThread.SysDestroy: waiting on thread');{$ENDIF}
+      // Before calling WaitFor, signal main thread with WakeMainThread, so pending checksynchronize calls are handled.
+      if assigned(WakeMainThread) then
+        WakeMainThread(Self);
       WaitFor;
       end;
     end;