X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fupdate_checker.cc;h=99060016f4b68bf68365d6166bc7d3ca82c868b2;hb=f508191f9d794e7762270d19a4211739470cfe0d;hp=4c5075e20f3d81a1e298cf0f914e3434fd616497;hpb=e975b14d2c962eab149f56a79c35b68b608226d4;p=dcpomatic.git diff --git a/src/lib/update_checker.cc b/src/lib/update_checker.cc index 4c5075e20..99060016f 100644 --- a/src/lib/update_checker.cc +++ b/src/lib/update_checker.cc @@ -1,28 +1,27 @@ /* Copyright (C) 2014-2015 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ #include "update_checker.h" #include "version.h" -#include "safe_stringstream.h" -#include "config.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; @@ -154,7 +161,7 @@ UpdateChecker::thread () _stable = stable; } - if (Config::instance()->check_for_test_updates() && version_less_than (dcpomatic_version, test)) { + if (version_less_than (dcpomatic_version, test)) { _test = test; }