码迷,mamicode.com
首页 > 其他好文 > 详细

boost thread 传递参数

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

标签:thread   boost   join   

#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 传递参数

标签:thread   boost   join   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!