1#include <thread>
2#include <chrono>
3
4void usleep_helper(unsigned int usec) {
5 // Break here in the helper
6 std::this_thread::sleep_for(rtime: std::chrono::duration<unsigned int, std::milli>(usec));
7}
8
9void *background_thread(void *arg) {
10 (void) arg;
11 for (;;) {
12 usleep_helper(usec: 2);
13 }
14}
15
16int main(void) {
17 unsigned int main_usec = 1;
18 std::thread main_thread(background_thread, nullptr); // Set bkpt here to get started
19 for (;;) {
20 usleep_helper(usec: main_usec);
21 }
22}
23

source code of lldb/test/API/functionalities/breakpoint/two_hits_one_actual/main.cpp