KERNEL OBJECTS - EVENT FLAGS
Event flags are semaphores that a thread can wait for. A wait for an event flag causes the
thread to yield to the scheduler if and until the event flag is set. The source for the
event flag routines is in event.c.
Each event flag has the following properties:
- value (<= 0: thread waits; >0: thread continues)
- reference count (event flag gets deleted when this goes zero)
- list of callbacks to be delivered next time event flag gets set
- name
- security attributes (who can access it)
These methods are defined:
- uLong oz_knl_event_create (int name_l, const char *name, OZ_Secattr *secattr, OZ_Event **event_r)
- create a new event flag, set value to zero
- void oz_knl_event_rename (OZ_Event *event, int name_l, const char *name)
- rename an event flag
- Long oz_knl_event_inc (OZ_Event *event, Long value)
- increment/decrement an event flag's value, return previous value
- Long oz_knl_event_set (OZ_Event *event, Long value)
- set an event flag's value, return previous value
- Long oz_knl_event_increfc (OZ_Event *event, Long inc)
- increment/decrement event flag's reference count
- uLong oz_knl_event_queuecb (OZ_Event *event, void (*entry) (void *param, OZ_Event *event), void *param)
- queue callback to be delivered when then event flag gets set
- uLong oz_knl_event_waitone (OZ_Event *event)
- current thread waits if event in the list is <= 0
- uLong oz_knl_event_waitlist (uLong nevents, OZ_Eventlist *eventlist, OZ_Procmode procmode, int si)
- current thread waits if all events in the list are <= 0
- OZ_Secattr *oz_knl_event_getsecattr (OZ_Event *event)
- get event flag's security attributes
- const char *oz_knl_event_getname (OZ_Event *event)
- get an event flag's name