मैं TThread
में कस्टम स्टैक आकार कैसे सेट कर सकता हूं? मैं TThread
के निर्माता को पुन: पेश करने की कोशिश कर रहा हूं लेकिन यह कहता है कि ThreadProc
अभी भी System.Classes
में ठीक है।टीटीएचड में स्टैक आकार कैसे सेट करें?
type
TThreadHelper = class helper for TThread
constructor Create(const CreateSuspended: Boolean = False; const StackSize: Integer = 0); reintroduce;
end;
{ TThreadHelper }
constructor TThreadHelper.Create(const CreateSuspended: Boolean; const StackSize: Integer);
begin
Self.FSuspended := not Self.FExternalThread;
Self.FCreateSuspended := CreateSuspended and not Self.FExternalThread;
if not Self.FExternalThread then
begin
Self.FHandle := BeginThread(nil, StackSize, @ThreadProc, Pointer(Self), CREATE_SUSPENDED, Self.FThreadID);
if Self.FHandle = 0 then
raise EThread.CreateResFmt(@SThreadCreateError, [SysErrorMessage(GetLastError)]);
end
else
begin
Self.FHandle := Winapi.Windows.GetCurrentThread;
Self.FThreadId := GetCurrentThreadId;
end;
end;
[dcc32 त्रुटि] Project5.dpr (29): E2003 अघोषित पहचानकर्ता: 'ThreadProc'
'ThreadProc' समारोह सार्वजनिक उपयोग के लिए नहीं है। यह यूनिट के 'इंटरफ़ेस' भाग में भी परिभाषित किया गया होगा। इसलिए संकलक इसे नहीं देख सकता है। – TLama