blob: a7a1c34fb671b683ce65edc1df831af6c8e82f3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include "server.h"
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#ifdef WIN32
/* hachish fix for mingw builds */
namespace boost {
void tss_cleanup_implemented() { }
}
#endif
int main(int argc, char **argv) {
boost::asio::io_service io_service;
Server server(io_service);
std::size_t num_threads = 1;
std::vector<boost::shared_ptr<boost::thread> > threads;
for(std::size_t i = 0; i < num_threads; 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 < num_threads; i++) {
threads[i]->join();
}
return 0;
}
|