Skip to content

Commit

Permalink
Merge pull request Light-City#55 from zgdgod/patch-1
Browse files Browse the repository at this point in the history
Update 2_5_id.cpp
  • Loading branch information
Light-City committed Aug 10, 2020
2 parents bb139ef + c6b3297 commit 3ef3091
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions concurrency/concurrency_v1/chapter2/2_5_id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ void some_core_part_of_algorithm() {
}

int main() {
std::cout << std::this_thread::get_id() << endl;
master_thread = std::this_thread::get_id();
std::cout << "master_thread: " << master_thread << endl;
cout << "master_thread 中运行:" << endl;
some_core_part_of_algorithm();
cout << "thread 中运行:" << endl;
thread t(some_core_part_of_algorithm);
t.join();
return 0;
}
}

0 comments on commit 3ef3091

Please sign in to comment.