const MIL_ID *EventArrayIdPtr, | //in |
MIL_INT EventArraySize, | //in |
MIL_INT64 WaitOption, | //in |
MIL_INT *StatePtr | //out |
This function allows you to synchronize the execution of threads by forcing the current thread to wait for one of the MIL events identified in a user-supplied array to change state. To force the current thread to wait for all events identified in the user-supplied array to change state, add M_ALL_OBJECTS to M_EVENT_WAIT or M_EVENT_SYNCHRONIZE when setting the WaitOption parameter.
Specifies the address of a user-supplied array that contains the identifiers of the MIL events for which to wait. All MIL event identifiers must be allocated, using MthrAlloc(), on the same system.
Specifies the wait option.
See the Parameter associations section for possible values that can be specified.
Specifies the address in which to write the returned value.
Since the MthrWaitMultiple() function also returns the requested information, you can set this parameter to M_NULL.
See the Parameter associations section for possible values that can be returned.
The table below lists possible values for the WaitOption parameter and possible values returned to the StatePtr parameter.
For specifying the wait
option
|
|||||||||||||||||||||||||||||||||||||||
WaitOption | Description
|
MIL system-specific tooltip (†) |
|||||||||||||||||||||||||||||||||||||
StatePtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_EVENT_SYNCHRONIZE + |
Allows the current thread to continue executing while forcing its corresponding on-board thread, located on the same board as the events identified in the user-supplied array, to wait for one of the events to be in an M_SIGNALED state or for a time out to occur. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Note that while a GPU system supports asynchronous calls, M_EVENT_SYNCHRONIZE will behave like M_EVENT_WAIT, as described above. |
† | d | |||||||||||||||||||||||||||||||||||||
M_UNKNOWN |
Specifies that WaitOption parameter is set to M_EVENT_SYNCHRONIZE. |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_EVENT_WAIT + |
Forces the current thread to wait for an event, identified in the user-supplier array, to change to the M_SIGNALED state or for the events to timeout. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_TIMEOUT |
Specifies that none of the events in the array have changed state before the time out interval is reached. |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
Value |
Specifies the index of the event that changed to the M_SIGNALED state. |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s |
You can add the following value to the above-mentioned values to specify that the current thread must wait for all events to change state or for a timeout to occur.
For specifying that the thread must wait
for all the events to change state
|
|||||||||||||||||||||||||||||||||||||||
WaitOption |
Description
|
||||||||||||||||||||||||||||||||||||||
StatePtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_ALL_OBJECTS |
Waits for all the events identified in the user-supplied array to be in a M_SIGNALED state or for the events to time out. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SIGNALED |
Specifies that all the events have changed state. |
||||||||||||||||||||||||||||||||||||||
M_TIMEOUT |
Specifies that the time out interval has been reached before all the events in the array have changed state. |
||||||||||||||||||||||||||||||||||||||
M_UNKNOWN |
Specifies that WaitOption parameter is set to M_EVENT_SYNCHRONIZE. |
You can add the following value to the above-mentioned values to set the time interval after which an event is considered to be timed out.
For events
|
|||||||||||||||||||||||||||||||||||||||
Combination value |
Description
|
||||||||||||||||||||||||||||||||||||||
Specifies the time interval after which an event is considered to be timed out. (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Sets the required timeout interval, in msecs. Set this parameter to the following: |
|||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||
|
Header | Include mil.h. |
Library | Use mil.lib. |
DLL | Requires mil.dll. |