Flag function. Allocates a flag object. A flag object behaves like an array of one bit semaphores. The object can hold up to MVAR_BITS - 1 flags. The flags can be used to simulate events, so a single thread can wait for several events simultaneously.
- Parameters:
-
| name | Name of the new flag object to create. If the last character in the name is an asteriks (*), the operating system automatically assigns the flag an unique name. name (the registry feature must be enabled for this automatism). This parameter can be NULL if the nano layer registry feature is not used and will not be used in future. |
- Returns:
- handle to the new flag object. NULL is returned on error.
- Note:
- NOSCFG_FEATURE_FLAGS must be defined to 1 to have flag support compiled in.
You must use nosFlagDestroy to destroy the flag object again.
Even if the function posFlagDestroy would work also, it is required to call nosFlagDestroy. Only this function removes the flag object from the registry.
Dependent of your configuration, this function can be defined as macro to decrease code size.
- See also:
- nosFlagGet, nosFlagSet, nosFlagDestroy