Re: Question about WaitForSingleObject() ?
From: Michael J. Salamone (mikesa#at#entrek#dot#com)
Date: 02/24/05
- Next message: Jeo: "Nesting interrupts with ARM core"
- Previous message: sergeir: "Re: Is it possible to..."
- In reply to: Knight Lin: "Question about WaitForSingleObject() ?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Feb 2005 03:32:34 -0800
Well, we know that nothing happens "at the same time".
It doesn't really matter which return code you get, does it? If the
function return indicates timeout, take your timeout path. In your timeout
path, you can still query if the event is set or not (call
WaitForSingleObject again, with 0 for timeout). Many times, this function
is run in the loop. So, you'd pick up the object signaled state on the next
iteration of the loop.
-- Michael Salamone [eMVP] Entrek Software, Inc. www.entrek.com "Knight Lin" <lhbb5405@hotmail.com> wrote in message news:O6FTeHlGFHA.2752@TK2MSFTNGP12.phx.gbl... > Hi all: > > As we know, function WaitForSingleObject(HANDLE hHandle, DWORD > dwMilliseconds ) returns when the specified object(hHandle) is in the > signaled state or when the time-out(dwMilliseconds ) interval elapses. > But,if the system is busy,then the object is signaled and time-out elapses > at the same time,so which return-value will be > returned,WAIT_OBJECT_0(object is signaled) or WAIT_TIMEOUT(time-out > interval elapsed, and the object's state is nonsignaled) ? > > > -------------- > Knight Lin >
- Next message: Jeo: "Nesting interrupts with ARM core"
- Previous message: sergeir: "Re: Is it possible to..."
- In reply to: Knight Lin: "Question about WaitForSingleObject() ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|