summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-09-23 17:50:31 +0100
committerCarl Hetherington <cth@carlh.net>2012-09-23 17:50:31 +0100
commite89fb9d81358b51ed0e231725f7fb6eb63f96c5b (patch)
tree7388764fb11b97f33c2ab9ffe8cea0679ce20d2e /test
parent6726393a4b186333b8e1080f3f1c5c4b77d4c2e6 (diff)
Use io_service per thread.
Diffstat (limited to 'test')
-rw-r--r--test/test.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/test.cc b/test/test.cc
index b77eb2b51..638d526e0 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -306,13 +306,12 @@ BOOST_AUTO_TEST_CASE (client_server_test)
ServerDescription description ("localhost", 2);
- thread* a = new thread (boost::bind (do_remote_encode, frame, &description, locally_encoded));
- thread* b = new thread (boost::bind (do_remote_encode, frame, &description, locally_encoded));
- thread* c = new thread (boost::bind (do_remote_encode, frame, &description, locally_encoded));
- thread* d = new thread (boost::bind (do_remote_encode, frame, &description, locally_encoded));
-
- a->join ();
- b->join ();
- c->join ();
- d->join ();
+ list<thread*> threads;
+ for (int i = 0; i < 8; ++i) {
+ threads.push_back (new thread (boost::bind (do_remote_encode, frame, &description, locally_encoded)));
+ }
+
+ for (list<thread*>::iterator i = threads.begin(); i != threads.end(); ++i) {
+ (*i)->join ();
+ }
}