diff --git a/rtl/go32v2/tthread.inc b/rtl/go32v2/tthread.inc index 85c59ded20..844960060b 100644 --- a/rtl/go32v2/tthread.inc +++ b/rtl/go32v2/tthread.inc @@ -46,7 +46,7 @@ begin end; -constructor TThread.Create(CreateSuspended: Boolean); +constructor TThread.Create(CreateSuspended: Boolean; const StackSize: DWord = DefaultStackSize); begin {IsMultiThread := TRUE; } diff --git a/rtl/openbsd/tthread.inc b/rtl/openbsd/tthread.inc index 5900095344..a523c7e7dd 100644 --- a/rtl/openbsd/tthread.inc +++ b/rtl/openbsd/tthread.inc @@ -186,7 +186,7 @@ begin end; { TThread } -constructor TThread.Create(CreateSuspended: Boolean); +constructor TThread.Create(CreateSuspended: Boolean; const StackSize: DWord = DefaultStackSize); begin // lets just hope that the user doesn't create a thread // via BeginThread and creates the first TThread Object in there! @@ -198,7 +198,7 @@ begin FInitialSuspended := CreateSuspended; FFatalException := nil; WRITE_DEBUG('creating thread, self = ',longint(self)); - FHandle:= BeginThread(@ThreadFunc, Pointer(Self), FThreadID); + FHandle:= BeginThread(@ThreadFunc, Pointer(Self), FThreadID, StackSize); WRITE_DEBUG('TThread.Create done'); end; diff --git a/rtl/wince/tthread.inc b/rtl/wince/tthread.inc index d2a2ce3d0c..528a8349a7 100644 --- a/rtl/wince/tthread.inc +++ b/rtl/wince/tthread.inc @@ -114,7 +114,7 @@ begin if FreeThread then Thread.Free; end; -constructor TThread.Create(CreateSuspended: Boolean); +constructor TThread.Create(CreateSuspended: Boolean; const StackSize: DWord = DefaultStackSize); var Flags: Integer; begin @@ -123,7 +123,7 @@ begin FSuspended := CreateSuspended; Flags := 0; if CreateSuspended then Flags := CREATE_SUSPENDED; - FHandle := BeginThread(nil, 0, @ThreadProc, pointer(self), Flags, FThreadID); + FHandle := BeginThread(nil, StackSize, @ThreadProc, pointer(self), Flags, FThreadID); FFatalException := nil; end;