[AMDGPU] Add True16 register classes.
[llvm-project.git] / lldb / test / API / commands / watchpoints / multiple_threads / main.cpp
blobec41e8e8ebfff072816e2f227c5a6c340c7d8d92
1 #include "pseudo_barrier.h"
2 #include <cstdio>
3 #include <thread>
5 volatile uint32_t g_val = 0;
6 pseudo_barrier_t g_barrier, g_barrier2;
8 void thread_func() {
9 pseudo_barrier_wait(g_barrier);
10 pseudo_barrier_wait(g_barrier2);
11 printf("%s starting...\n", __FUNCTION__);
12 for (uint32_t i = 0; i < 10; ++i)
13 g_val = i;
16 int main(int argc, char const *argv[]) {
17 printf("Before running the thread\n");
18 pseudo_barrier_init(g_barrier, 2);
19 pseudo_barrier_init(g_barrier2, 2);
20 std::thread thread(thread_func);
22 printf("After launching the thread\n");
23 pseudo_barrier_wait(g_barrier);
25 printf("After running the thread\n");
26 pseudo_barrier_wait(g_barrier2);
28 thread.join();
30 return 0;