22 #ifndef EVENT_H_INCLUDE 23 #define EVENT_H_INCLUDE 32 #define EVENT_LOOP_SIZE 1024 77 #define event_signal(func, args) event_signal_ext(func, args, #func, __FILE__, __LINE__)
struct event_loop event_loop_t
char * name
Name of the event, used for debugging.
void event_loop_destroy()
Frees any memory associated with the event queue.
void event_destroy(event_t *e)
Free any memory associated with an event.
void event_signal_ext(void *func, void *args, char *name, char *s_name, uint16_t s_line)
int occupied
Does this loop already have a worker thread.
event_t * event_loop_take(event_loop_t *event_loop)
event_t * event_init(void(*func)(scheduler_t *, void *), void *arg, char *name, char *source_name, uint16_t source_line)
uint16_t s_line
Sample source line number.
void event_loop_terminate()
Stops the event loop from executing.
void * argument
The arguments for the function.
uint16_t source_line
Line in the source file creating the event.
int event_loop_put(event_loop_t *event_loop, event_t *event)
int event_loop_enter(scheduler_t *scheduler, void(*)(scheduler_t *), void(*)(scheduler_t *))
Enters the event loop.
GAsyncQueue * queue
The queue that is the core of the event loop.
Header file for the scheduler.
char * source_name
Name of the source file creating the event.
char * s_name
Sample source file name.
int terminated
Flag that signals the end of the event loop.