There is a sleep() call in idGlobal!

Giganews Newsgroups
Subject: There is a sleep() call in idGlobal!
Posted by:  Martin James (mjames_falc…@dial.pipex.com)
Date: Tue, 23 Mar 2004

I've just found out that many of my units are calling this instead of
Windows.sleep:

procedure Sleep(ATime: cardinal);
begin
  {$IFDEF LINUX}
  if (not Assigned(GStack)) then begin
    GStack := TIdStack.CreateStack;
  end;
  // what if the user just calls sleep? without doing anything...
  GStack.WSSelect(nil, nil, nil, ATime);
  {$ENDIF}
  {$IFDEF MSWINDOWS}
  Windows.Sleep(ATime);
  {$ENDIF}
end;

What does this method, (esp WSselect) do??  I'm calling it all over the
place, including in threads!

Could Indy please rename this procedure!!!!

Rgds,
Martin

Replies