git-svn-id: trunk@29712 -
@@ -236,7 +236,7 @@ begin
// 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
// 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
Resume;
{$endif}
@@ -1602,7 +1602,7 @@ type
procedure Queue(aMethod: TThreadMethod);
property ReturnValue: Integer read FReturnValue write FReturnValue;
property Terminated: Boolean read FTerminated;
-{$ifdef windows}
+{$if defined(windows) or defined(OS2)}
private
FInitialSuspended: boolean;
@@ -107,8 +107,11 @@ var
Flags: cardinal;
begin
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;
+ FInitialSuspended := CreateSuspended;
if FSuspended then Flags := Flags or dtSuspended;
FHandle := BeginThread (nil, StackSize, @ThreadProc, pointer (Self),
Flags, FThreadID);