Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/EricPengShuai/Interview
/ t1
Function
t1
STL/thread.cpp:16–23 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
14
mutex mtx;
15
16
void t1() // 普通的函数,用来执行线程
17
{
18
for (int i = 0; i < 3; ++i) {
19
// lock_guard<mutex> lg(mtx);
20
cout <<
"t1 111\n"
;
21
sleep(1);
22
}
23
}
24
25
void t2()
26
{
Callers
1
main
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected