<div dir="ltr">@Greg, the author of the other fix and I have sort of decided among ourselves to abandon his fix and use this instead.<div><br></div><div>@Zach, would it be better if I just rewrote this entire test with C++11 instead of C? Should that be a general rule for all tests in the future?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 27, 2015 at 9:40 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">REPOSITORY<br>
  rL LLVM<br>
<br>
================<br>
Comment at: lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:58<br>
@@ -56,3 +57,3 @@<br>
<span class=""><br>
-    pthread_barrier_wait(&g_barrier);<br>
+    while (!g_ready);<br>
<br>
</span>----------------<br>
std::condition_variable?<br>
<br>
================<br>
Comment at: lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:65<br>
@@ -63,3 +64,3 @@<br>
         // random micro second sleep from zero to 3 seconds<br>
         int usec = ::rand() % 3000000;<br>
         printf ("%s (thread = %u) doing a usleep (%d)...\n", __FUNCTION__, thread_index, usec);<br>
----------------<br>
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.<br>
<br>
================<br>
Comment at: lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:93-95<br>
@@ -93,5 +92,5 @@<br>
<span class="">     // Create 3 threads<br>
     err = ::pthread_create (&g_thread_1, NULL, thread_func, &thread_index_1);<br>
     err = ::pthread_create (&g_thread_2, NULL, thread_func, &thread_index_2);<br>
     err = ::pthread_create (&g_thread_3, NULL, thread_func, &thread_index_3);<br>
<br>
</span>----------------<br>
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.<br>
<div class="HOEnZb"><div class="h5"><br>
<a href="http://reviews.llvm.org/D7933" target="_blank">http://reviews.llvm.org/D7933</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br></div>