commit
3ef3091fd1
@ -27,8 +27,12 @@ void some_core_part_of_algorithm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
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);
|
thread t(some_core_part_of_algorithm);
|
||||||
t.join();
|
t.join();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user