summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-01-07 19:19:34 +0000
committerAdrian Prantl <aprantl@apple.com>2019-01-07 19:19:34 +0000
commit9e9e7b38e0e656b77aeece4435ac09a068eb54e7 (patch)
treef416936713e7416c40c9229618ad1bc3a61c1c1c /lldb/packages/Python/lldbsuite
parenta6d29024edb02516728fe8c2983841e1fb66e993 (diff)
downloadbcm5719-llvm-9e9e7b38e0e656b77aeece4435ac09a068eb54e7.tar.gz
bcm5719-llvm-9e9e7b38e0e656b77aeece4435ac09a068eb54e7.zip
Refactor test, no changes expected.
llvm-svn: 350557
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/macosx/queues/main.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/queues/main.c b/lldb/packages/Python/lldbsuite/test/macosx/queues/main.c
index 34b4607c662..3978b92bff1 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/queues/main.c
+++ b/lldb/packages/Python/lldbsuite/test/macosx/queues/main.c
@@ -4,7 +4,7 @@
#include <dispatch/dispatch.h>
#include <pthread.h>
-int finished_enqueueing_work = 0;
+atomic_int finished_enqueueing_work = 0;
atomic_int thread_count = 0;
void
@@ -54,7 +54,7 @@ submit_work_2(void *in)
dispatch_async_f (*work_performer_2, NULL, doing_the_work_2);
dispatch_async_f (*work_performer_2, NULL, doing_the_work_2);
}
- finished_enqueueing_work = 1;
+ atomic_fetch_add(&finished_enqueueing_work, 1);
}
@@ -144,11 +144,8 @@ int main (int argc, const char **argv)
});
// Unfortunately there is no pthread_barrier on darwin.
- while (atomic_load(&thread_count) < 13)
- sleep(1);
-
- while (finished_enqueueing_work == 0)
+ while ((atomic_load(&thread_count) < 13) || (finished_enqueueing_work == 0))
sleep (1);
- stopper ();
+ stopper ();
}
OpenPOWER on IntegriCloud