[Lldb-commits] [lldb] r350266 - Add file-based synching to places missed in r350247.

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 2 14:37:28 PST 2019


Author: adrian
Date: Wed Jan  2 14:37:28 2019
New Revision: 350266

URL: http://llvm.org/viewvc/llvm-project?rev=350266&view=rev
Log:
Add file-based synching to places missed in r350247.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py?rev=350266&r1=350265&r2=350266&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py Wed Jan  2 14:37:28 2019
@@ -31,14 +31,14 @@ class TestQueues(TestBase):
         self.main_source = "main.c"
 
     def remove_token(self, name):
-        for i in range(6):
-            token = name+'.token.%d'%(i+1)
+        for i in range(7):
+            token = name+'.token.%d'%i
             if os.path.exists(token):
                 os.remove(token)
 
     def await_token(self, name):
-        for i in range(6):
-            lldbutil.wait_for_file_on_target(self, name+'.token.%d'%(i+1))
+        for i in range(7):
+            lldbutil.wait_for_file_on_target(self, name+'.token.%d'%i)
 
     def check_queue_for_valid_queue_id(self, queue):
         self.assertTrue(

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c?rev=350266&r1=350265&r2=350266&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c Wed Jan  2 14:37:28 2019
@@ -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);
                 });




More information about the lldb-commits mailing list