diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-01-30 22:54:38 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-01-30 22:54:38 +0100 |
| commit | ea6b2dae46caa1da829fbf499e83cd6ae3b3773a (patch) | |
| tree | f8f978b762fad664a4c8d5fdc11d8c7145ee09a8 /src/lib/butler.cc | |
| parent | a1546fb6c4e59621d99271b8ca996e96a574f7b3 (diff) | |
Various thread cleanups.
Diffstat (limited to 'src/lib/butler.cc')
| -rw-r--r-- | src/lib/butler.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc index 6062b0f21..20180330e 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -83,9 +83,9 @@ Butler::Butler ( get_video() to be called in response to this signal. */ _player_change_connection = _player->Change.connect (bind (&Butler::player_change, this, _1), boost::signals2::at_front); - _thread = new boost::thread (bind (&Butler::thread, this)); + _thread = boost::thread (bind(&Butler::thread, this)); #ifdef DCPOMATIC_LINUX - pthread_setname_np (_thread->native_handle(), "butler"); + pthread_setname_np (_thread.native_handle(), "butler"); #endif /* Create some threads to do work on the PlayerVideos we are creating; at present this is used to @@ -110,13 +110,12 @@ Butler::~Butler () _prepare_pool.join_all (); _prepare_service.stop (); - _thread->interrupt (); + _thread.interrupt (); try { - _thread->join (); - } catch (boost::thread_interrupted& e) { - /* No problem */ + _thread.join (); + } catch (...) { + } - delete _thread; } /** Caller must hold a lock on _mutex */ |
