[Lldb-commits] [PATCH] Fixes http://reviews.llvm.org/rL230691

Zachary Turner zturner at google.com
Fri Feb 27 09:40:56 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:58
@@ -56,3 +57,3 @@
 
-    pthread_barrier_wait(&g_barrier);
+    while (!g_ready);
 
----------------
std::condition_variable?

================
Comment at: lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:65
@@ -63,3 +64,3 @@
         // random micro second sleep from zero to 3 seconds
         int usec = ::rand() % 3000000;
         printf ("%s (thread = %u) doing a usleep (%d)...\n", __FUNCTION__, thread_index, usec);
----------------
I understand this isn't your code, but RAND_MAX is not guaranteed to be > 32768.  On Windows, it isn't.  std::random would be better here.

================
Comment at: lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:93-95
@@ -93,5 +92,5 @@
     // Create 3 threads
     err = ::pthread_create (&g_thread_1, NULL, thread_func, &thread_index_1);
     err = ::pthread_create (&g_thread_2, NULL, thread_func, &thread_index_2);
     err = ::pthread_create (&g_thread_3, NULL, thread_func, &thread_index_3);
 
----------------
Since we're already bringing in std::atomic, how about std::thread while we're at it?  That would make this testcase compile on Windows.

http://reviews.llvm.org/D7933

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list