#include "stdafx.h"
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <iostream>
using namespace std;
class testCreateThread
{
public:
void show();
};
void testCreateThread::show()
{
cout<<"Create Thread Success!"<<endl;
};
int _tmain(int argc, _TCHAR* argv[])
{
boost::shared_ptr<testCreateThread> pThr;
pThr = boost::shared_ptr<testCreateThread>(new testCreateThread());
//起一个线程
boost::thread(boost::bind(&testCreateThread::show,pThr));
//主要进程继续执行...
int i = 0;
while(i<100000000)
{
++i;
}
getchar();
return 0;
}
11-13
1422
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交