summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/thread/step_out/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/functionalities/thread/step_out/main.cpp')
-rw-r--r--lldb/test/functionalities/thread/step_out/main.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/lldb/test/functionalities/thread/step_out/main.cpp b/lldb/test/functionalities/thread/step_out/main.cpp
index eb390d5de2e..b4c6216d6bf 100644
--- a/lldb/test/functionalities/thread/step_out/main.cpp
+++ b/lldb/test/functionalities/thread/step_out/main.cpp
@@ -10,8 +10,8 @@
// This test is intended to create a situation in which two threads are stopped
// at a breakpoint and the debugger issues a step-out command.
-#include <pthread.h>
#include <atomic>
+#include <thread>
// Note that although hogging the CPU while waiting for a variable to change
// would be terrible in production code, it's great for testing since it
@@ -34,7 +34,7 @@ void step_out_of_here() {
}
void *
-thread_func (void *input)
+thread_func ()
{
// Wait until both threads are running
pseudo_barrier_wait(g_barrier);
@@ -48,19 +48,16 @@ thread_func (void *input)
int main ()
{
- pthread_t thread_1;
- pthread_t thread_2;
-
// Don't let either thread do anything until they're both ready.
pseudo_barrier_init(g_barrier, 2);
// Create two threads
- pthread_create (&thread_1, NULL, thread_func, NULL);
- pthread_create (&thread_2, NULL, thread_func, NULL);
+ std::thread thread_1(thread_func);
+ std::thread thread_2(thread_func);
// Wait for the threads to finish
- pthread_join(thread_1, NULL);
- pthread_join(thread_2, NULL);
+ thread_1.join();
+ thread_2.join();
return 0;
}
OpenPOWER on IntegriCloud