void listener_func() {
    while (!g_done) {
        SBEvent event;
        bool got_event = g_listener.WaitForEvent(1, event);
        if (got_event) {
            if (!event.IsValid())
                throw Exception("event is not valid in listener thread");

            SBStream description;
            event.GetDescription(description);
            string str(description.GetData());
            g_event_descriptions.push(str);
        }
    }
}