Explorar el Código

Merged revisions 2158 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

r2158 (jonas)
* applied r2098 change regarding threads destroying themselves to
the other bsd variants

git-svn-id: branches/fixes_2_0@2164 -

Jonas Maebe hace 19 años
padre
commit
817afe71c1
Se han modificado 3 ficheros con 3 adiciones y 3 borrados
  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