Changeset cc305b5 for message.c

Timestamp:
May 30, 2011, 10:27:31 PM (13 years ago)
Author:
Adam Glasgall <glasgall@mit.edu>
Branches:
master, release-1.10, 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.
(No files)

Note: See TracChangeset for help on using the changeset viewer.