X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Flib%2Fupdate_checker.cc;h=99060016f4b68bf68365d6166bc7d3ca82c868b2;hb=dc87773c69beb0249c1d50841730a10a496b563a;hp=e3bbd663ee254af8abbc68fabf71774edb2141f6;hpb=3828baf56467224f5d44049bf1e7a7ed11f43a05;p=dcpomatic.git diff --git a/src/lib/update_checker.cc b/src/lib/update_checker.cc index e3bbd663e..99060016f 100644 --- a/src/lib/update_checker.cc +++ b/src/lib/update_checker.cc @@ -20,9 +20,8 @@ #include "update_checker.h" #include "version.h" -#include "safe_stringstream.h" #include "util.h" -#include "raw_convert.h" +#include #include #include #include @@ -37,6 +36,7 @@ using std::string; using std::vector; using boost::is_any_of; using boost::ends_with; +using dcp::raw_convert; /** Singleton instance */ UpdateChecker* UpdateChecker::_instance = 0; @@ -75,6 +75,9 @@ void UpdateChecker::start () { _thread = new boost::thread (boost::bind (&UpdateChecker::thread, this)); +#ifdef DCPOMATIC_LINUX + pthread_setname_np (_thread->native_handle(), "update-checker"); +#endif } UpdateChecker::~UpdateChecker () @@ -86,8 +89,12 @@ UpdateChecker::~UpdateChecker () _condition.notify_all (); if (_thread) { - DCPOMATIC_ASSERT (_thread->joinable ()); - _thread->join (); + /* Ideally this would be a DCPOMATIC_ASSERT(_thread->joinable()) but we + can't throw exceptions from a destructor. + */ + if (_thread->joinable ()) { + _thread->join (); + } } delete _thread;