第一种方法:
boost::function0<void> f = boost::bind(&AppServer::publishServerIp, this, server_ip);
boost::shared_ptr<boost::thread> get_status_thread_ = boost::make_shared<boost::thread>(f);
如果只写第一句,回报错。
如果只写第一句的boost::bind(&AppServer::publishServerIp, this, server_ip); 并不能正常开启线程。
只有两句写全才正常开启线程。原因未知,以后再看
第二种方法:
boost::thread_group Thrd;
Thrd.create_thread(boost::bind(&Capture::fun, this, NULL, 6, 0, “”));
只写boost::bind(&Capture::video, this, frameMainRight, 6, 0, “”),也不行,原因同上