当前位置: 首页 > news >正文

泰安网站建设平台创建一个公司要多少钱

泰安网站建设平台,创建一个公司要多少钱,微商引流推广,如何找到做网站的客户c 11 线程编程实战 目录 c 11 线程编程实战1,线程的创建1.1 传入无参函数1.2 传入有参函数1.3 传入类内部函数1.4 lambda表达式 1,线程的创建 1.1 传入无参函数 //传入函数,创建线程 void ThreadMain() {//获取线程IDstd::thread::id thi…

c++ 11 线程编程实战

目录

  • c++ 11 线程编程实战
  • 1,线程的创建
    • 1.1 传入无参函数
    • 1.2 传入有参函数
    • 1.3 传入类内部函数
    • 1.4 lambda表达式

1,线程的创建

1.1 传入无参函数

//传入函数,创建线程
void  ThreadMain()
{//获取线程IDstd::thread::id  thisthreadId = std::this_thread::get_id();cout << "begin thread main" << endl;
}
int  main()
{thread  th1(ThreadMain);th1.join();
}

1.2 传入有参函数

//传入带参数的函数,创建线程
void  ThreadMainCanshu(int a, int b)
{//获取线程IDstd::thread::id  thisthreadId = std::this_thread::get_id();cout << "begin ThreadMainCanshu" << endl;cout << "a : " << a << endl;cout << "b : " << b << endl;
}
int  main()
{thread  th2(ThreadMainCanshu, 1, 2);th2.join();
}

1.3 传入类内部函数

//传入类成员函数创建线程
class  MyThread
{
public:void Main(){//获取线程IDstd::thread::id  thisthreadId = std::this_thread::get_id();cout << "My Thread Main" << endl;thread th1(&MyThread::thcanshu, this, 10, 20);th1.detach();Sleep(10);}void  thcanshu(int a,int b){cout << "MyThread : a " << a << " b " << b << endl;}
};
void  dealth1()
{MyThread  myth;thread  th3(&MyThread::thcanshu, &myth, 10, 20);th3.join();
}void  dealth2()
{MyThread  myth;myth.Main();
}
int  main()
{dealth1();dealth2();
}

1.4 lambda表达式

std::thread  my_thread([]{cout<<"my thread"<<endl;
}
);
my_thread.join();
http://www.dtcms.com/a/485558.html

相关文章:

  • 怎样让网站显示网站建设中网站做视频窗口接口收费么
  • 网站带app建设新手做视频网站好
  • 个人网站建设软件百度权重是什么
  • 旅游网站开发的意义是什么北京网站优化推广效果
  • 做科技申报看什么网站照片模板图片
  • 阿里OSS做网站图库费用绵阳做网站公司
  • 如何做网站的百科十年经验网站开发企业
  • 网站建设com网站跨境电商app下载
  • 怎么建设网站网页游戏沈阳免费seo关键词优化排名
  • 北京快三开奖走势图一定牛梅州网站优化公司
  • 从零开始学做网站cdsn做个支付网站多少钱
  • 沙田网站仿做网站建设最好的
  • 永济做网站单价做网站80端口
  • 上市公司网站建设评价网站建设论文读书笔记
  • 庄浪县县住房建设局网站建盏金盏能不能喝茶
  • 上海品牌网站建设公司排名怎么做广告宣传效果好
  • 怎么搭建自己的网站挣钱企业邮箱注册域名
  • 做网站详细教程建筑网站architect
  • 建站比较好的公司益阳网站建设广告
  • 宿州移动网站建设广西建设厅网站是什么
  • 景点网站怎么做德语网站建设
  • 三合一网站和传统网站wordpress 颜色插件
  • 深圳罗湖网站设计公司91福利社区wordpress
  • 酒泉建设厅网站wordpress商业网站
  • 模板网站 怎么做优化网站设计基础
  • 旅游的网站怎么做金华网站建设报价
  • 企业网站做留言板有什么优势陕西网站建设培训
  • 公司做网站的申请上海做网站比较好的
  • 免费自助网站建设郑州汉狮哪家做网站好
  • 湛江网站公司网站建设选择云主机吗