当前位置:网站首页>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));
}边栏推荐
- CorelDRAW 2022中文精简64位直装版下载
- 静态域与静态方法
- 我想知道股票开户怎么开户?究竟网上开户是否安全么?
- A preliminary understanding of operator overloading
- Sitge joined the opengauss open source community to jointly promote the ecological development of the database industry
- SWT/ANR问题--Deadlock
- SWT/ANR问题--Native方法执行时间过长导致SWT
- Find the length of the common part of two line segments
- SWT / anr problem - anr/je causes SWT
- Zero foundation self-study SQL course | window function
猜你喜欢

VirtualBox installation enhancements

CorelDRAW 2022 Chinese Simplified 64 bit direct download

VirtualBox 安装增强功能

(translation) use eyebrow shaped text to improve Title click through rate

How to realize the scene linkage of intelligent lock, lamp and intelligent curtain motor in zhiting?

SWT / anr problem - binder stuck
The latest CSDN salary increase technology stack in 2022 overview of APP automated testing

go导入自建包
![Pytorch —— 基礎指北_貳 高中生都能看懂的[反向傳播和梯度下降]](/img/6e/279dbb7a8d7a5ecd240de464c5b8b2.png)
Pytorch —— 基礎指北_貳 高中生都能看懂的[反向傳播和梯度下降]

halcon变量窗口的图像变量不显示,重启软件和电脑都没用
随机推荐
How to maintain efficient collaboration in remote office and achieve stable growth of projects | community essay solicitation
求两个线段公共部分的长度
機器學習10-信念貝葉斯分類器
最新微信ipad协议 CODE获取 公众号授权等
[Agora] user management
现在开户有优惠吗?另外,手机开户安全么?
What are the applications of SMS in enterprises?
[multi source BFS] 934 Shortest Bridge
AS400 large factory interview
centos 安装多个版本的php并切换
halcon变量窗口的图像变量不显示,重启软件和电脑都没用
SWT / anr problem - SWT caused by long execution time of native method
十大劵商如何开户?还有,在线开户安全么?
【JS】【掘金】获取关注了里不在关注者里的人
7-2 punch in reward DP for puzzle a
[proteus simulation] Arduino UNO +74c922 keyboard decoding drive 4x4 matrix keyboard
522. 最长的特殊序列 II
[2022] Jiangxi postgraduate mathematical modeling scheme and code
Batch import of Excel data in applet
Fast understanding of forward proxy and reverse proxy