Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class server
- {
- public:
- server( unsigned short int thrNum ) :
- {
- if( thrNum )
- threadPool = thrNum;
- };
- ~server()
- {
- };
- void run()
- {
- std::vector<boost::thread*> threads;
- for(std::size_t i = 0; i < threadPool; ++i)
- {
- threads.push_back( new boost::thread( boost::bind(&seed::server::pollEvent,this) ) );
- }
- for( auto & x : threads )
- x->join();
- for( auto & x : threads )
- x->detach();
- for( auto & x : threads )
- delete x;
- };
- private:
- void pollEvent() { return; };
- unsigned short int threadPool = 1;
- };
Advertisement
Add Comment
Please, Sign In to add comment