g_mutex_lock(&priv->event_lock);
/* Wait for room in the event queue */
while( g_queue_get_length(priv->event_queue) >= EVENT_QUEUE_MAX_LENGTH )
g_mutex_lock(&priv->event_lock);
/* Wait for room in the event queue */
while( g_queue_get_length(priv->event_queue) >= EVENT_QUEUE_MAX_LENGTH )