Browse Source

- disabled fix for mantis 6693 from r5662 since the fix itself also
contains a race condition

git-svn-id: trunk@5670 -

Jonas Maebe 18 years ago
parent
commit
1867a46f34
1 changed files with 3 additions and 3 deletions
  1. 3 3
      rtl/unix/tthread.inc

+ 3 - 3
rtl/unix/tthread.inc

@@ -82,11 +82,11 @@ begin
     // free ourselves before TThread.Create has finished
     // (since that one may check our VTM in case of $R+, and
     //  will call the AfterConstruction method in all cases)
-    LThread.Suspend;
+//    LThread.Suspend;
     WRITE_DEBUG('AfterConstruction should have been called for ',ptrint(lthread));
     if LThread.FInitialSuspended then
       begin
-        LThread.Suspend;
+        CurrentTM.SemaphoreWait(LThread.FSem);
         if not(LThread.FTerminated) then
           begin
             if not LThread.FSuspended then
@@ -142,7 +142,7 @@ begin
   FSem := CurrentTM.SemaphoreInit();
   if FSem = nil then
     raise EThread.create('Semaphore init failed (possibly too many concurrent threads)');
-  FSuspended := False;
+  FSuspended := CreateSuspended;
   FSuspendedExternal := false;
   FInitialSuspended := CreateSuspended;
   FFatalException := nil;