首页 > 编程语言 > 详细

[C++11] thread

时间:2015-07-25 16:53:23      阅读:304      评论:0      收藏:0      [点我收藏+]

C++11标准库支持了thread,在MAC上试一试:

#include <iostream>
#include <thread>

void hello(void)
{
	std::cout << "Hello concurrent world" << std::endl;
}

int main(void)
{
	std::thread t(hello);
	t.join();
}
命令行编译(如果用xcode编译和其它oc工程一样简单):

clang++ thread.cpp -o thread -std=c++11
执行:

Hello concurrent world

调用栈:

技术分享

版权声明:本文为博主原创文章,未经博主允许不得转载。

[C++11] thread

原文:http://blog.csdn.net/yamingwu/article/details/47057249

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