当前位置:网站首页>Thread Detach
Thread Detach
2022-07-01 02:23:00 【Upper moon screen】
#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));
}边栏推荐
- halcon数组的一些使用
- QML control type: tooltip
- SWT/ANR问题--ANR/JE引发SWT
- The mobile edge browser cannot open the third-party application
- Laravel event & Monitoring
- Pytorch —— 基础指北_贰 高中生都能看懂的[反向传播和梯度下降]
- SWT / anr problem - storagemanagerservice stuck
- Zero foundation self-study SQL course | window function
- VirtualBox installation enhancements
- In the fourth week of June, the list - flying melon data up main growth ranking list (BiliBili platform) was released!
猜你喜欢
随机推荐
P6773 [NOI2020] 命运(dp、线段树合并)
What is the difference between port number and process number?
SAP ALV汇总跟导出Excel 汇总数据不一致
Alphabet rearrange inator 3000 (dictionary tree custom sorting)
PMP是什么?
(translation) use eyebrow shaped text to improve Title click through rate
Pycharm 打开远程目录 Remote Host
go: finding module for package
LabVIEW计算相机图像传感器分辨率以及镜头焦距
FL studio20.9 fruit software advanced Chinese edition electronic music arrangement
[multi source BFS] 934 Shortest Bridge
Clickhouse eliminates the gap caused by group by
nacos配置中心使用教程
Objects and object variables
Calculate special bonus
SWT/ANR问题--ANR/JE引发SWT
Static domain and static method
LabVIEW calculates the camera image sensor resolution and lens focal length
[punch in questions] integrated daily 5 questions sharing (phase I)
静态域与静态方法






