Skip to content

Commit f81cbd2

Browse files
committed
..
1 parent e8a3ca2 commit f81cbd2

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required (VERSION 3.26)
2+
3+
project (thread.pool)
4+
5+
set (CMAKE_CXX_STANDARD 23)
6+
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
7+
8+
set (SOURCES
9+
main.cpp
10+
)
11+
12+
find_package(Boost 1.81 REQUIRED thread)
13+
14+
include_directories (
15+
/usr/local/include
16+
/opt/homebrew/include
17+
${CMAKE_CURRENT_SOURCE_DIR}
18+
)
19+
20+
link_directories (
21+
/usr/local/lib
22+
/opt/homebrew/lib
23+
)
24+
25+
add_executable (thread.pool ${SOURCES})
26+
27+
target_link_libraries (thread.pool
28+
29+
Boost::thread
30+
)
31+

cpp.c++20/jthread/jthread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int main()
2626
});
2727

2828
// Pause the main thread before cancelling the jthread
29-
this_thread::sleep_for(5s);
29+
this_thread::sleep_for(3s);
3030

3131
// request for our jthread to stop
3232
jt0.request_stop();

0 commit comments

Comments
 (0)