#include <iostream> #include <boost/thread/thread.hpp> void HelloWorld() { std::cout << "Hello world, I‘m a thread!" << std::endl; } int main() { boost::thread thread1(&HelloWorld); thread1.join(); system("pause");
return 0; }
运行结果如下:
原文:http://www.cnblogs.com/gaohongchen01/p/4006920.html