当前位置:网站首页>Thread Detach
Thread Detach
2022-07-01 02:20:00 【月上纱窗】
#include <iostream>
#include <chrono>
#include <thread>
void independentThread()
{
std::cout << "Starting concurrent thread.\n";
std::this_thread::sleep_for(std::chrono::seconds(2));
std::cout << "Exiting concurrent thread.\n";
}
void threadCaller()
{
std::cout << "Starting thread caller.\n";
std::thread t(independentThread);
t.detach();
std::this_thread::sleep_for(std::chrono::seconds(1));
std::cout << "Exiting thread caller.\n";
}
int main()
{
threadCaller();
std::this_thread::sleep_for(std::chrono::seconds(5));
}边栏推荐
- Int and bit group turn to each other
- (translation) use eyebrow shaped text to improve Title click through rate
- SWT / anr problem - SWT caused by long execution time of native method
- 十大券商有哪些?另外想问,现在在线开户安全么?
- The image variables in the Halcon variable window are not displayed, and it is useless to restart the software and the computer
- MySQL insert \ pre update + judgment condition
- Clickhouse eliminates the gap caused by group by
- Factory + strategy mode
- SWT/ANR问题--StorageManagerService卡住
- P6773 [NOI2020] 命运(dp、线段树合并)
猜你喜欢

How does ZABBIX configure alarm SMS? (alert SMS notification setting process)

halcon变量窗口的图像变量不显示,重启软件和电脑都没用

What are the applications of SMS in enterprises?

(翻译)使用眉状文本提高标题点击率

LabVIEW计算相机图像传感器分辨率以及镜头焦距

修复表中的名字(首字符大写,其他小写)

Analysis on user behavior loss of data exploration e-commerce platform

如何在智汀中实现智能锁与灯、智能窗帘电机场景联动?

最新微信ipad协议 CODE获取 公众号授权等

What is project management?
随机推荐
Factory + strategy mode
最新微信ipad协议 CODE获取 公众号授权等
[multi source BFS] 934 Shortest Bridge
CorelDRAW 2022中文精简64位直装版下载
Some uses of Halcon array
Leetcode 面试题 17.10. 主要元素
项目管理是什么?
Comment réaliser la liaison entre la serrure intelligente et la lampe, la scène du moteur de rideau intelligent dans le timing intelligent?
机器学习10-信念贝叶斯分类器
【毕业季·进击的技术er】--毕业到工作小结
(总结一)Halcon基础之寻找目标特征+转正
求两个线段公共部分的长度
@The difference between configurationproperties and @value
Alphabet rearrange inator 3000 (dictionary tree custom sorting)
现在开户有优惠吗?另外,手机开户安全么?
2022年最新csdn涨薪技术栈-app自动化测试概述
(translation) reasons why real-time inline verification is easier for users to make mistakes
(翻译)使用眉状文本提高标题点击率
SWT/ANR问题--Dump时间过长导致的SWT
How to maintain efficient collaboration in remote office and achieve stable growth of projects | community essay solicitation