| Server Side Delphi - Kestral Computing | Start | Index | Next |
Example |
|||
Borland: Classes.pas
function TThread.WaitFor: LongWord;
var Msg: TMsg;
begin
if GetCurrentThreadID = MainThreadID then
while MsgWaitForMultipleObjects(1, FHandle, False,
INFINITE, QS_SENDMESSAGE) = WAIT_OBJECT_0 + 1
do PeekMessage(Msg, 0, 0, 0, PM_NOREMOVE)
else
WaitForSingleObject(FHandle, INFINITE);
GetExitCodeThread(FHandle, Result);
end;
destructor TThread.Destroy;
begin
if not FFinished and not Suspended then
begin
Terminate;
WaitFor; // Be very careful
end;
if FHandle <> 0 then CloseHandle(FHandle);
inherited Destroy;
RemoveThread;
end;
|
(Access violation Fixed in D4 upgrade 2)
| Grahame Grieve |