浏览代码

* fix for bug #16884 for OS/2

git-svn-id: trunk@29712 -
Tomas Hajny 10 年之前
父节点
当前提交
590e2f7977
共有 3 个文件被更改,包括 6 次插入3 次删除
  1. 1 1
      rtl/objpas/classes/classes.inc
  2. 1 1
      rtl/objpas/classes/classesh.inc
  3. 4 1
      rtl/os2/tthread.inc

+ 1 - 1
rtl/objpas/classes/classes.inc

@@ -236,7 +236,7 @@ begin
 // enable for all platforms once http://bugs.freepascal.org/view.php?id=16884
 // enable for all platforms once http://bugs.freepascal.org/view.php?id=16884
 // is fixed for all platforms (in case the fix for non-unix platforms also
 // is fixed for all platforms (in case the fix for non-unix platforms also
 // requires this field at least)
 // requires this field at least)
-{$if defined(unix) or defined(windows)}
+{$if defined(unix) or defined(windows) or defined(os2)}
   if not FExternalThread and not FInitialSuspended then
   if not FExternalThread and not FInitialSuspended then
     Resume;
     Resume;
 {$endif}
 {$endif}

+ 1 - 1
rtl/objpas/classes/classesh.inc

@@ -1602,7 +1602,7 @@ type
     procedure Queue(aMethod: TThreadMethod);
     procedure Queue(aMethod: TThreadMethod);
     property ReturnValue: Integer read FReturnValue write FReturnValue;
     property ReturnValue: Integer read FReturnValue write FReturnValue;
     property Terminated: Boolean read FTerminated;
     property Terminated: Boolean read FTerminated;
-{$ifdef windows}
+{$if defined(windows) or defined(OS2)}
   private
   private
     FInitialSuspended: boolean;
     FInitialSuspended: boolean;
 {$endif}
 {$endif}

+ 4 - 1
rtl/os2/tthread.inc

@@ -107,8 +107,11 @@ var
   Flags: cardinal;
   Flags: cardinal;
 begin
 begin
   AddThread;
   AddThread;
-  Flags := dtStack_Commited;
+  { Always start in suspended state, will be resumed in AfterConstruction if necessary
+    See Mantis #16884 }
+  Flags := dtStack_Commited or dtSuspended;
   FSuspended := CreateSuspended;
   FSuspended := CreateSuspended;
+  FInitialSuspended := CreateSuspended;
   if FSuspended then Flags := Flags or dtSuspended;
   if FSuspended then Flags := Flags or dtSuspended;
   FHandle := BeginThread (nil, StackSize, @ThreadProc, pointer (Self),
   FHandle := BeginThread (nil, StackSize, @ThreadProc, pointer (Self),
                                                              Flags, FThreadID);
                                                              Flags, FThreadID);