|
Sets the flag to a specified state, or changes the flag's state to set or clear. If there are threads waiting for the flag object's state to change this way, all of them will become active. If there were higher priority threads already waiting before this one, the context switch may happen immediately. -
Parameters:
-
ptr_flag
|
A pointer to the initialized Flag object |
state
|
The desired state; "TRUE" for set, "FALSE" for clear |
-
Returns:
-
None
#include <cywin.h>
...
struct Flag data_busy;
...
Flag_ctor( &data_busy, "shared_data", FALSE );
...
if( Flag_wait_clear( &data_busy, 1000 ) )
{
Flag_set_Ex( &data_busy, TRUE );
...
...
Flag_set_Ex( &data_busy, FALSE );
}
else
{
TRACE( "Timeout while trying to access." );
}
...
Flag_dtor( &data_busy, LEAVE_MEMORY );
...
-
See also:
-
Flag_set.
|