var
wTimer, lBusy : Longint;
interval : LARGE_INTEGER;
lThreadAssigned: boolean;
//label 1;
begin
//Another one, courtesy of [name deleted]...
//The question arises: what happens if you call this procedure and FirstProgressThread = False ?
// 1:
if not FirstProgressThread then
begin
wTimer := CreateWaitableTimer(nil, True, PAnsiChar('ProgressThreadWaiter' + IntToStr(GetTickCount)));
interval.QuadPart := -1000000 * 1;
Repeat
SetWaitableTimer(wTimer, TLargeInteger(interval), 0, nil, nil, false);
lBusy := WaitForSingleObject(wTimer, INFINITE);
Until FirstProgressThread;
CancelWaitableTimer(wTimer);
CloseHandle(wTimer);
end;
if FirstProgressThread then
begin
TaskIsInProgress := true;
ProgressThread := TProgressServer.Create(true);
ProgressThread.ServerAdress := AXmlOptions.ServerDomain;
ProgressThread.StatusTask := Status;
ProgressThread.TaskIDProg := TaskID;
ProgressThread.pboThread := pboThread;
ProgressThread.Resume;
FirstProgressThread := false;
end;
{ else
goto 1; }
end;
Again, mostra din codul de la job ... se exemplifica doua modalitati de a bloca un program : bucle infinite si salturi neconditionate

Tema pentru acasa : gasiti inca doua metode pentru a bloca un program

P.S. am sters numele scris pe acolo, pentru a nu face reclama
