[mythtv-commits] mythtv/master commit: 7b36b04a6 by Gavin Hurlbut (Beirdo)

MythTV noreply at mythtv.org
Tue Aug 9 08:05:12 UTC 2011


      Author:  Gavin Hurlbut <ghurlbut at mythtv.org>
 Change Date:  2011-08-08T23:32:02-07:00
   Push Date:  2011/08/09 01:05:04 -0700
  Repository:  mythtv
      Branch:  master
New Revision:  7b36b04a634aa3ef34260f2d53f0397e5516f6b7
   Changeset:  https://github.com/MythTV/mythtv/commit/7b36b04a6

Log:

Fix MThreads startup by making the thread list dynamically init

It seems that a static thread definition (such as logThread in logging.cpp
amongst others) can end up using the MThread ctor before the statics for
the s_all_threads_lock and s_all_threads are initialized, causing a crash on
startup in some situations.

To get around this, I've changed them to be null initialized pointers (so they
are initialized statically and earlier), and initialize them on first MThread
ctor call as necessary.  There may be a more graceful fix, but this works.

In MThread::Cleanup(), a small restructure was needed such that the lock on
s_all_threads_lock can be unlocked before we delete it.

Modified:

   mythtv/libs/libmythbase/mthread.cpp



More information about the mythtv-commits mailing list