diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-01-02 22:37:28 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-01-02 22:37:28 +0000 |
commit | 3b2136e55e80bdbbd20de7f06cf94ff697c6112f (patch) | |
tree | 8ac2799f9beecbeca1a3f82f141d01240f581394 /lldb/packages/Python/lldbsuite/test/macosx/queues/main.c | |
parent | 41f5710328c855adc6da24a54513f9ecbd576cd1 (diff) | |
download | bcm5719-llvm-3b2136e55e80bdbbd20de7f06cf94ff697c6112f.tar.gz bcm5719-llvm-3b2136e55e80bdbbd20de7f06cf94ff697c6112f.zip |
Add file-based synching to places missed in r350247.
llvm-svn: 350266
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/macosx/queues/main.c')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/macosx/queues/main.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/queues/main.c b/lldb/packages/Python/lldbsuite/test/macosx/queues/main.c index 9e7c1a8aedc..f2a73f19e9f 100644 --- a/lldb/packages/Python/lldbsuite/test/macosx/queues/main.c +++ b/lldb/packages/Python/lldbsuite/test/macosx/queues/main.c @@ -6,6 +6,7 @@ #include <pthread.h> int finished_enqueueing_work = 0; +char *name = NULL; void touch (const char *name, unsigned n) @@ -23,6 +24,7 @@ touch (const char *name, unsigned n) void doing_the_work_1(void *in) { + touch (name, 0); while (1) sleep (1); } @@ -94,6 +96,9 @@ stopper () int main (int argc, const char **argv) { + if (argc != 2) + return 2; + name = argv[1]; dispatch_queue_t work_submittor_1 = dispatch_queue_create ("com.apple.work_submittor_1", DISPATCH_QUEUE_SERIAL); dispatch_queue_t work_submittor_2 = dispatch_queue_create ("com.apple.work_submittor_and_quit_2", DISPATCH_QUEUE_SERIAL); dispatch_queue_t work_submittor_3 = dispatch_queue_create ("com.apple.work_submittor_3", DISPATCH_QUEUE_SERIAL); @@ -115,37 +120,37 @@ int main (int argc, const char **argv) dispatch_async (dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ pthread_setname_np ("user initiated QoS"); - touch(argv[1], 1); + touch(name, 1); while (1) sleep (10); }); dispatch_async (dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{ pthread_setname_np ("user interactive QoS"); - touch(argv[1], 2); + touch(name, 2); while (1) sleep (10); }); dispatch_async (dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{ pthread_setname_np ("default QoS"); - touch(argv[1], 3); + touch(name, 3); while (1) sleep (10); }); dispatch_async (dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{ pthread_setname_np ("utility QoS"); - touch(argv[1], 4); + touch(name, 4); while (1) sleep (10); }); dispatch_async (dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^{ pthread_setname_np ("background QoS"); - touch(argv[1], 5); + touch(name, 5); while (1) sleep (10); }); dispatch_async (dispatch_get_global_queue(QOS_CLASS_UNSPECIFIED, 0), ^{ pthread_setname_np ("unspecified QoS"); - touch(argv[1], 6); + touch(name, 6); while (1) sleep (10); }); |