Author: labath Date: Mon Apr 4 09:18:21 2016 New Revision: 265294 URL: http://llvm.org/viewvc/llvm-project?rev=265294&view=rev Log: Fix flakyness in TestWatchpointMultipleThreads
This addresses the same problem as r264846 (the test not expecting the situation when two thread hit the watchpoint simultaneously), but for a different test. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py?rev=265294&r1=265293&r2=265294&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py Mon Apr 4 09:18:21 2016 @@ -54,9 +54,6 @@ class HelloWatchLocationTestCase(TestBas 'stop reason = breakpoint']) # Now let's set a write-type watchpoint pointed to by 'g_char_ptr'. - # The main.cpp, by design, misbehaves by not following the agreed upon - # protocol of using a mutex while accessing the global pool and by not - # incrmenting the global pool by 2. self.expect("watchpoint set expression -w write -s 1 -- g_char_ptr", WATCHPOINT_CREATED, substrs = ['Watchpoint created', 'size = 1', 'type = w']) # Get a hold of the watchpoint id just created, it is used later on to Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp?rev=265294&r1=265293&r2=265294&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp Mon Apr 4 09:18:21 2016 @@ -43,15 +43,13 @@ uint32_t access_pool (bool flag = false) { static std::mutex g_access_mutex; - if (!flag) - g_access_mutex.lock(); + g_access_mutex.lock(); char old_val = *g_char_ptr; if (flag) do_bad_thing_with_location(g_char_ptr, old_val + 1); - if (!flag) - g_access_mutex.unlock(); + g_access_mutex.unlock(); return *g_char_ptr; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits