diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
commit | 14f1b3e8826ce43b978db93a62d1166055db5394 (patch) | |
tree | 0a00ad8d3498783fe0193f3b656bca17c4c8697d /packages/Python/lldbsuite/test/macosx/queues/main.c | |
parent | 4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/macosx/queues/main.c')
-rw-r--r-- | packages/Python/lldbsuite/test/macosx/queues/main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/Python/lldbsuite/test/macosx/queues/main.c b/packages/Python/lldbsuite/test/macosx/queues/main.c index fa6a3e570ae35..715a3f3af52cc 100644 --- a/packages/Python/lldbsuite/test/macosx/queues/main.c +++ b/packages/Python/lldbsuite/test/macosx/queues/main.c @@ -3,6 +3,8 @@ #include <dispatch/dispatch.h> #include <pthread.h> +int finished_enqueueing_work = 0; + void doing_the_work_1(void *in) { @@ -45,6 +47,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; } @@ -73,6 +76,7 @@ stopper () sleep (1); } + int main () { dispatch_queue_t work_submittor_1 = dispatch_queue_create ("com.apple.work_submittor_1", DISPATCH_QUEUE_SERIAL); @@ -126,8 +130,8 @@ int main () }); - sleep (1); + while (finished_enqueueing_work == 0) + sleep (1); stopper (); } - |