92 #if !GLIB_CHECK_VERSION(2, 32, 0)
107 #if GLIB_CHECK_VERSION(2, 32, 0)
109 sec * 1000000 + usec)) == NULL)
112 timeout.tv_sec = sec;
113 timeout.tv_usec = usec;
114 g_get_current_time(&timeout);
115 g_time_val_add(&timeout, 1000000);
116 if((ret = g_async_queue_timed_pop(
event_loop->
queue, &timeout)) == NULL)
120 if(ret->
func == NULL)
202 V_EVENT(
"EVENT: creating event: [%p, %p, %s, %s, %d]", func, args, name,
s_name,
s_line);
248 signal_call(scheduler);
252 if(TVERB_EVENT && strcmp(e->
name,
"log_event") != 0)
256 if(TVERB_EVENT && strcmp(e->
name,
"log_event") != 0)
262 update_call(scheduler);
281 event_signal(NULL, NULL);
event_loop_t * event_loop_get()
int event_loop_put(event_loop_t *event_loop, event_t *e)
void event_destroy(event_t *e)
Free any memory associated with an event.
void event_loop_terminate()
Stops the event loop from executing.
void event_signal_ext(void *func, void *args, char *name, char *s_name, uint16_t s_line)
event_t * event_loop_take(event_loop_t *event_loop)
event_loop_t vl_singleton
int event_loop_enter(scheduler_t *scheduler, void(*update_call)(scheduler_t *), void(*signal_call)(scheduler_t *))
Enters the event loop.
event_t * event_init(void(*func)(scheduler_t *, void *), void *arg, char *name, char *source_name, uint16_t source_line)
void event_loop_destroy()
Frees any memory associated with the event queue.
Event handling operations.
GThread * main_thread
Pointer to the main thread.
Header file for the scheduler.
GAsyncQueue * queue
The queue that is the core of the event loop.
int terminated
Flag that signals the end of the event loop.
int occupied
Does this loop already have a worker thread.
char * name
Name of the event, used for debugging.
char * source_name
Name of the source file creating the event.
void(* func)(scheduler_t *, void *)
The function that will be executed for this event.
void * argument
The arguments for the function.
uint16_t source_line
Line in the source file creating the event.
char * s_name
Sample source file name.
uint16_t s_line
Sample source line number.