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

网站建设项目经理的工作北京企业建站定制

网站建设项目经理的工作,北京企业建站定制,h5调用小程序api,优化大师免费版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/498594.html

相关文章:

  • gta5买房网站建设中在线制作图片上加字
  • 福州网站建设方案开发国家企业信用信息查询平台官网
  • 网站服务器无法访问旺店通erp企业版下载app
  • 网站项目计划书范文商务网站建设与规划
  • 集团网站下分网站 模板如何搭建o2o网站
  • 海东市住房和城乡建设局网站asp网站攻击
  • 如何申请建设网站域名一个小型网站开发成本
  • 做app网站的软件有哪些内容iis 配置网站 404页面
  • 国外优秀人像摄影网站腾讯云可以做网站吗
  • 如何建设网站pdf网站更换程序
  • 商会网站建设方案书神马关键词快速排名软件
  • 设计网站的合同wordpress 侧边栏删除
  • 在线做c语言题目的网站横沥镇网站建设公司
  • 用织梦模板做网站国内永久免费服务器
  • 网站建设综合实训心得合肥网站制作
  • 自助建站网站哪个好怎么做h5动态页面
  • 品牌网站建设十小蝌蚪甘肃建设厅执业资格注册中心网站
  • 长沙优化网站获客软件服务好的成都网站建设
  • 西安在线网站制作大名网站建设费用
  • 长尾词挖掘海口seo外包
  • 手机网站怎么做淘宝客动漫设计和动漫制作技术的区别
  • 柳州柳北建设局网站杭州室内设计公司
  • 三明购物网站开发设计lol做任务领头像网站
  • 杭州知名的企业网站建设策划个人做门户网站
  • 网站多种语言是怎么做的广州天河 网站建设
  • 做网站是什么职业中国建筑app下载
  • 建设安全带官方网站如何配置iis网站
  • 珠海模板开发建站asp网站设计代做
  • 网站图片上传却不显示不出来把wordpress图标去掉
  • 网站名称和备案不一样河南省鹤壁市住房和城乡建设局网站