Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Mar : Sleep() or Synchronize() from whithin DLL

www.cryer.info
Managed Newsgroup Archive

Sleep() or Synchronize() from whithin DLL

Subject:Sleep() or Synchronize() from whithin DLL
Posted by:"Marcelo Grossi" (no@spam.com)
Date:19 Mar 2008 09:42:04

Hi there,
I have a monitoring thread that just pools some values off of windows performance counters. To get the CPU % usage of my monitored processes I need to Sleep for at least 1 second and then get the values again so I can calculate the %.
When I call Sleep(1000); my thread never gets back from it. It enters in a Coma O.O! The same happens when I try to post my results back to the DLL using an Event through Synchronize();.
Any ideas? The Thread works perfectly in a regular App.

Execute;
begin
  while not terminated do
  begin
    Get Values;
    Sleep(1000);
  end;
end;

Thank you,

Marcelo Grossi

Replies:

www.cryer.info
Managed Newsgroup Archive