We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caa755f commit 5ccc104Copy full SHA for 5ccc104
compiler-rt/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp
@@ -1,27 +1,17 @@
1
#include <sys/types.h>
2
#include <thread>
3
#include <unistd.h>
4
-#include <vector>
5
6
template <typename T>
7
void launcher(T func) {
8
- std::vector<std::thread> pool;
+ auto t1 = std::thread(func);
+ auto t2 = std::thread(func);
9
10
- for (int i = 0; i < 10; i++) {
11
- pool.emplace_back(std::thread(func));
12
- }
13
-
14
- for (auto &t : pool) {
15
- t.join();
16
+ t1.join();
+ t2.join();
17
}
18
19
-void h() {}
20
21
-void g() {
22
- fork();
23
- launcher<>(h);
24
-}
+void g() {}
25
26
void f() {
27
fork();
0 commit comments