Skip to content

Commit e1e42af

Browse files
roland-wolfsgerbino
authored andcommitted
Wait till say_hello() has completed
The join statement removes the race between thread_pool and main thread.
1 parent 0e6d7e5 commit e1e42af

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

example/hello-task/hello_task.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ int main()
2222
{
2323
capy::thread_pool pool;
2424
capy::run_async(pool.get_executor())(say_hello());
25+
pool.join();
2526
return 0;
2627
}

0 commit comments

Comments
 (0)