Merge pull request #55 from zgdgod/patch-1

Update 2_5_id.cpp
This commit is contained in:
Francis 2020-08-10 19:56:20 +08:00 committed by GitHub
commit 3ef3091fd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}