Overview
Features
Download
Documentation
Community
Add-Ons & Services

Poco::Event windows

Please post support and help requests here.

Poco::Event windows

Postby mar0na » 19 Mar 2013, 19:04

Hello,

Why is the timeout "milliseconds" incremented with one?

Additional I search a function with that I could check if the event is set without wait. In Windows this is possibile with WaitForSingleObject and dwMilliseconds is zero. Is something exist for Linux?

from:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
"dwMilliseconds [in]
The time-out interval, in milliseconds. If a nonzero value is specified, the function waits until the object is signaled or the interval elapses. If dwMilliseconds is zero, the function does not enter a wait state if the object is not signaled; it always returns immediately. If dwMilliseconds is INFINITE, the function will return only when the object is signaled."


Event_WIN32.cpp:

Code: Select all
bool EventImpl::waitImpl(long milliseconds)
{
   switch (WaitForSingleObject(_event, milliseconds + 1))            // <- ????
   {
   case WAIT_TIMEOUT:
      return false;
   case WAIT_OBJECT_0:
      return true;
   default:
      throw SystemException("wait for event failed");      
   }
}


Thanks.
mar0na
 
Posts: 1
Joined: 19 Mar 2013, 18:46

Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest