summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index bb165a1..3827607 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,14 +1,25 @@
-#include <iostream>
#include "music.h"
#include "httpd.h"
+#include <iostream>
+#include <vector>
+
+#include <boost/thread.hpp>
+
int main(int argc, char **argv) {
try {
music::init(argv[1]);
boost::asio::io_service io_service;
HTTPServer httpd(io_service);
- io_service.run();
+ std::vector<boost::shared_ptr<boost::thread> > threads;
+ for(std::size_t i = 0; i < 10; i++) {
+ boost::shared_ptr<boost::thread> thread(new boost::thread(boost::bind(&boost::asio::io_service::run, &io_service)));
+ threads.push_back(thread);
+ }
+ for(std::size_t i = 0; i < 10; i++) {
+ threads[i]->join();
+ }
} catch(std::exception& e) {
std::cerr << e.what() << std::endl;
}