llvm-capstone/lldb/test
Med Ismail Bennani 8f549c5329 [lldb/test] Fix data racing issue in TestStackCoreScriptedProcess
This patch should fix an nondeterministic error in TestStackCoreScriptedProcess.

In order to test both the multithreading capability and shared library
loading in Scripted Processes, the test would create multiple threads
that would take the same variable as a reference.

The first thread would alter the value and the second thread would
monitor the value until it gets altered. This assumed a certain ordering
regarding the `std::thread` spawning, however the ordering was not
always guaranteed at runtime.

To fix that, the test now makes use of a `std::condition_variable`
shared between the each thread. On the former, it will notify the other
thread when the variable gets initialized or updated and on the latter,
it will wait until the variable it receives a new notification.

This should fix the data racing issue while preserving the testing
coverage.

rdar://98678134

Differential Revision: https://reviews.llvm.org/D139484

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-01-12 19:20:51 -08:00
..
API [lldb/test] Fix data racing issue in TestStackCoreScriptedProcess 2023-01-12 19:20:51 -08:00
Shell [LLDB] Change formatting to use llvm::formatv 2023-01-09 11:29:43 -08:00
Unit Use lit_config.substitute instead of foo % lit_config.params everywhere 2022-03-16 09:57:41 +01:00
CMakeLists.txt [lldb] Add LTO dependency to lldb test suite 2022-12-22 10:15:20 -08:00
lit.cfg.py
lit.site.cfg.py.in Use lit_config.substitute instead of foo % lit_config.params everywhere 2022-03-16 09:57:41 +01:00