Fixed minor bug - wait for event queue condition IF the queue is empty, not WHILE...
[rodin/chimara.git] / libchimara / event.c
index 5da6dd8e5058c60f97dbcbfaad265167ee36c561..88b09f02c1f31ce0fba2dfec6c35e2eb2f15432b 100644 (file)
@@ -76,7 +76,7 @@ glk_select(event_t *event)
        g_mutex_lock(glk_data->event_lock);
 
        /* Wait for an event */
-       while( g_queue_is_empty(glk_data->event_queue) )
+       if( g_queue_is_empty(glk_data->event_queue) )
                g_cond_wait(glk_data->event_queue_not_empty, glk_data->event_lock);
 
        event_t *retrieved_event = g_queue_pop_tail(glk_data->event_queue);