首页 > 其他 > 详细

boost thread 传递参数

时间:2017-07-30 09:52:20      阅读:441      评论:0      收藏:0      [点我收藏+]

#include <boost/thread/thread.hpp>

#include <boost/bind.hpp>

#include <iostream>


void threadFunc(const char* pszContext)

{

std::cout << pszContext << std::endl;

}


int main(int argc, char* argv[])

{

char* pszContext = "fengyuzaitu@126.com";

boost::thread thread1(boost::bind(&threadFunc, pszContext));

thread1.join();

return 0;

}


参考http://blog.csdn.net/iamnieo/article/details/2908621


boost thread 传递参数

原文:http://fengyuzaitu.blog.51cto.com/5218690/1951940

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!