فهرست منبع

* applied r2098 change regarding threads destroying themselves to
the other bsd variants

git-svn-id: trunk@2158 -

Jonas Maebe 19 سال پیش
والد
کامیت
f92f8501ff
3فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      rtl/darwin/tthread.inc
  2. 1 1
      rtl/netbsd/tthread.inc
  3. 1 1
      rtl/openbsd/tthread.inc

+ 1 - 1
rtl/darwin/tthread.inc

@@ -200,7 +200,7 @@ end;
 
 destructor TThread.Destroy;
 begin
-  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) then begin
+  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) and not ffinished then begin
     raise EThreadDestroyCalled.Create('A thread cannot destroy itself except by setting FreeOnTerminate and leaving!');
   end;
   // if someone calls .Free on a thread with

+ 1 - 1
rtl/netbsd/tthread.inc

@@ -196,7 +196,7 @@ end;
 
 destructor TThread.Destroy;
 begin
-  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) then begin
+  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) and not ffinished then begin
     raise EThreadDestroyCalled.Create('A thread cannot destroy itself except by setting FreeOnTerminate and leaving!');
   end;
   // if someone calls .Free on a thread with

+ 1 - 1
rtl/openbsd/tthread.inc

@@ -205,7 +205,7 @@ end;
 
 destructor TThread.Destroy;
 begin
-  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) then begin
+  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) and not ffinished then begin
     raise EThreadDestroyCalled.Create('A thread cannot destroy itself except by setting FreeOnTerminate and leaving!');
   end;
   // if someone calls .Free on a thread with