7 volatile bool debugger_flag
= true; // The debugger will flip this to false
9 void *start(void *data
)
12 size_t idx
= (size_t)data
;
15 if ( idx
== 0 && debugger_flag
)
16 std::this_thread::sleep_for(std::chrono::microseconds(1)); // Set breakpoint here
17 std::this_thread::sleep_for(std::chrono::seconds(1));
22 int main(int argc
, char const *argv
[])
26 static const size_t nthreads
= 16;
27 std::thread threads
[nthreads
];
30 for (i
=0; i
<nthreads
; i
++)
31 threads
[i
] = std::move(std::thread(start
, (void*)i
));
33 for (i
=0; i
<nthreads
; i
++)