The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

agent::wait_for_one Method

Waits for any one of the specified agents to complete its task.

static void __cdecl wait_for_one(
   size_t _Count,
   _In_reads_(_Count) agent ** _PAgents,
   agent_status& _Status,
   size_t& _Index,
   unsigned int _Timeout = COOPERATIVE_TIMEOUT_INFINITE


The number of agent pointers present in the array _PAgents.


An array of pointers to the agents to wait for.


A reference to a variable where the agent status will be placed.


A reference to a variable where the agent index will be placed.


The maximum time for which to wait, in milliseconds.

An agent task is completed when the agent enters the agent_canceled or agent_done states.

If the parameter _Timeout has a value other than the constant COOPERATIVE_TIMEOUT_INFINITE, the exception operation_timed_out is thrown if the specified amount of time expires before the agent has completed its task.

Header: agents.h

Namespace: concurrency

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft