diff options
author | Pavel Labath <labath@google.com> | 2016-04-04 14:18:21 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-04-04 14:18:21 +0000 |
commit | 67f641dd33a711037a92286090960c8a8314cf98 (patch) | |
tree | 7e3bd08f92b93c72b07d77e84e87b851376fbf37 /lldb/packages/Python/lldbsuite/test | |
parent | ccfe3cb3d63e0a8244d3d41d537c27363cacc750 (diff) | |
download | bcm5719-llvm-67f641dd33a711037a92286090960c8a8314cf98.tar.gz bcm5719-llvm-67f641dd33a711037a92286090960c8a8314cf98.zip |
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.
llvm-svn: 265294
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
2 files changed, 2 insertions, 7 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py index 85bdfe430df..ce30d269bbf 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py @@ -54,9 +54,6 @@ class HelloWatchLocationTestCase(TestBase): '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 diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp index 59b0afc6d5f..e20a6d988c8 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/main.cpp @@ -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; } |