Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/andreasfertig/programming-with-cpp20
/ DoLocked
Function
DoLocked
01.15-invocable1/main.cpp:13–18 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
11
std::mutex globalOsMutex;
12
13
void DoLocked(std::invocable auto&& f)
14
{
15
std::lock_guard lck{globalOsMutex};
16
17
f();
18
}
19
20
int main()
21
{
Callers
1
main
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected