Subj : Re: waitformultipleobjects() on several semaphores ? To : comp.programming.threads From : Joseph Seigh Date : Mon Feb 07 2005 12:50 pm On Mon, 7 Feb 2005 08:59:24 -0800, Neill Clift [MSFT] wrote: > "Neill Clift [MSFT]" wrote in message > news:420556d5$1@news.microsoft.com... > ... >> >> I'll see if I can get it clarified. >> Thanks. >> > > It does seem to have a clear statement of this when I > checked this morning on MSDN website: > When bWaitAll is FALSE, this function checks the handles in the array in order starting with index 0, until one of the objects is signaled. If multiple objects become signaled, the function returns the index of the first handle in the array whose object was signaled. > The function modifies the state of some types of synchronization objects. > Modification occurs only for the object or objects whose signaled state > caused the function to return. For example, the count of a semaphore object > is decreased by one. For more information, see the documentation for the > individual synchronization objects. > It's just slightly confusing terminology. To make it unambiguous, it should say that modification only occurs for the synchronization object that is returned in the index of WAIT_OBJECT_0 for the bWaitAll == FALSE case , and maybe list the synchronization objects that do get modified by wait. The documentation doesn't actually say that the first object found signaled is the one that actually caused it to return. It just says that's the index it returns. And it mentions twices that multiple objects can be signaled. It's not clear. -- Joe Seigh .