Changeset 0a9ffc5 for logging.c


Ignore:
Timestamp:
Aug 7, 2012, 10:55:09 PM (9 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.9
Children:
7c539a8, 4d9e311c, f03ca48
Parents:
b303ba2
Message:
Fix race condition in starting up logger thread

The context should be created by the main thread. It's accessed by both
so, by the time owl_log_init returns, we need to be sure it exists.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • logging.c

    rf271129 r0a9ffc5  
    429429static gpointer owl_log_thread_func(gpointer data)
    430430{
    431   log_context = g_main_context_new();
    432431  log_loop = g_main_loop_new(log_context, FALSE);
    433432  g_main_loop_run(log_loop);
     
    438437{
    439438  GError *error = NULL;
     439  log_context = g_main_context_new();
    440440  logging_thread = g_thread_create(owl_log_thread_func,
    441441                                   NULL,
Note: See TracChangeset for help on using the changeset viewer.