summaryrefslogtreecommitdiff
path: root/src/lib/server.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-24 16:03:21 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-24 16:03:21 +0100
commite975b14d2c962eab149f56a79c35b68b608226d4 (patch)
tree0959a5d0f4680538c1f080659e82b5bf073bba6c /src/lib/server.cc
parentb7ef3e79b9eb4f245556e69c68ee624c5b43e126 (diff)
assert (joinable) before joining threads.
Diffstat (limited to 'src/lib/server.cc')
-rw-r--r--src/lib/server.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc
index 260f2e469..dd076a049 100644
--- a/src/lib/server.cc
+++ b/src/lib/server.cc
@@ -81,15 +81,17 @@ Server::~Server ()
_full_condition.notify_all ();
}
- for (vector<boost::thread*>::iterator i = _worker_threads.begin(); i != _worker_threads.end(); ++i) {
- (*i)->join ();
- delete *i;
+ BOOST_FOREACH (boost::thread* i, _worker_threads) {
+ DCPOMATIC_ASSERT (i->joinable ());
+ i->join ();
+ delete i;
}
_io_service.stop ();
_broadcast.io_service.stop ();
if (_broadcast.thread) {
+ DCPOMATIC_ASSERT (_broadcast.thread->join ());
_broadcast.thread->join ();
}
}