Changeset cc305b5 for owl.c


Ignore:
Timestamp:
May 30, 2011, 10:27:31 PM (10 years ago)
Author:
Adam Glasgall <glasgall@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
6376af1, 28cd43f9, 83a4af3
Parents:
44976fe
git-author:
Adam Glasgall <adam@crossproduct.net> (02/28/11 11:33:59)
git-committer:
Adam Glasgall <glasgall@mit.edu> (05/30/11 22:27:31)
Message:
Move log-writing onto a background thread.

Currently, Barnowl writes message logs on the same thread as the UI
and other I/O. This means that if writing log files is very slow
(e.g. if logpath or classlogpath point to somewhere in AFS and the
fileserver that volume relies on is very slow to respond), barnowl
freezes up until the write completes. This patch creates a background
logging thread as part of initialization and runs a main loop on that
thread. Logging is then accomplished by posting tasks that write to
log files to that thread, a la how other threads can post tasks to the
UI thread's main loop.

Post a quit task to the logging thread's mainloop instead of quitting directly

Calling g_main_quit() on the main thread to quit the logging thread could resultin log tasks still in its queue getting lost. Instead, after we've shut down
everything that could log messages, post a quit task to the log thread so that
it'll only get run after everything outstanding has been processed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r44976fe rcc305b5  
    611611  g_source_unref(source);
    612612
     613  owl_log_init();
     614
    613615  owl_function_debugmsg("startup: entering main loop");
    614616  owl_select_run_loop();
     
    618620  owl_signal_shutdown();
    619621  owl_shutdown_curses();
     622  owl_log_shutdown();
    620623  return 0;
    621624}
Note: See TracChangeset for help on using the changeset viewer.