llvm-project/lldb/include/lldb
Greg Clayton 1e20f021f3 Fix some long standing issues that caused tests to be flaky.
The main issues were:
- Listeners recently were converted over to used by getting a shared pointer to a listener. And when they listened to broadcasters they would get a strong reference added to them meaning the listeners would never go away. This caused memory usage to increase and would cause performance issue if many steps were done.
- The lldb_private::Process private state thread had an issue where if a "stop" contol signal was attempted to be sent to that thread, it could end up not responding in 2 seconds and end up getting cancelled which might cause us to cancel a thread that had a mutex locked and it would deadlock the test.

This change makes broadcasters hold onto weak references to listeners. It also fixes some bad threading code that had races inside of it by making the m_events_mutex be non-recursive and getting rid of fragile use of a Predicate<bool> to say that new events are available, and replacing it with using the m_events_mutex with a new m_events_condition to control access to the events in a safer way.

The private state thread now uses a safer way to communicate that the control event has been received by the private state thread: it makes a EventDataReceipt instance that it attaches to the event that sends the control to the private state thread and used this to synchronize the fact that the private state thread has received the event instead of using a Predicate<bool> to convey the info. When the signal event is received, it will pull the event off of the queue in the private state thread and cause the EventData::DoOnRemoval() to be called, which will signal that the event has been received. This cleans up the signal delivery notification so it doesn't rely on a member variable of the process class to convey the info.

std::shared_ptr<EventDataReceipt> event_receipt_sp(new EventDataReceipt());
m_private_state_control_broadcaster.BroadcastEvent(signal, event_receipt_sp);

<rdar://problem/26256353> Listeners are being kept around longer than they should be due to recent changs
<rdar://problem/26256258> Private process state thread can be cancelled and cause deadlocks in test suite

llvm-svn: 269377
2016-05-12 22:58:52 +00:00
..
API Add the ability to limit "source regexp" breakpoints to a particular function 2016-04-28 01:40:57 +00:00
Breakpoint Add the ability to limit "source regexp" breakpoints to a particular function 2016-04-28 01:40:57 +00:00
Core Fix some long standing issues that caused tests to be flaky. 2016-05-12 22:58:52 +00:00
DataFormatters Add support for synthetic child providers to optionally return a customized typename for display 2016-05-02 00:41:24 +00:00
Expression [fix] Fixed a bug where const this would cause parser errors about $__lldb_expr. 2016-04-29 18:09:03 +00:00
Host Turn on LLDB_EDITLINE_USE_WCHAR on NetBSD 2016-05-12 19:46:08 +00:00
Initialization Fix Clang-tidy misc-use-override warnings in include/lldb/Expression and include/lldb/Initialization, unify inclusion guards 2015-08-18 09:18:19 +00:00
Interpreter Add support for synthetic child providers to optionally return a customized typename for display 2016-05-02 00:41:24 +00:00
Symbol Keep original source path and mapped path in LineEntry 2016-05-11 22:46:53 +00:00
Target Fix some long standing issues that caused tests to be flaky. 2016-05-12 22:58:52 +00:00
Utility Add a helper function to ProcessStructReader to allow one to inquire about the offset of a field 2016-01-22 23:50:46 +00:00
lldb-defines.h Add UNUSED_IF_ASSERT_DISABLED and apply it. 2015-07-24 00:23:29 +00:00
lldb-enumerations.h Update comment in lldb-enumerations.h 2016-04-22 08:41:07 +00:00
lldb-forward.h Fix some long standing issues that caused tests to be flaky. 2016-05-12 22:58:52 +00:00
lldb-private-defines.h Add -Wimplicit-fallthrough command line option to clang in 2016-02-16 04:14:33 +00:00
lldb-private-enumerations.h Backend support for top-level Clang epxressions 2016-03-22 21:05:51 +00:00
lldb-private-forward.h Refactor Unix signals. 2015-07-14 01:09:28 +00:00
lldb-private-interfaces.h Change over the broadcaster/listener process to hold shared or weak pointers 2016-03-07 21:50:25 +00:00
lldb-private-types.h Certain hardware architectures have registers of 256 bits in size 2016-03-10 00:14:29 +00:00
lldb-private.h Add -Wimplicit-fallthrough command line option to clang in 2016-02-16 04:14:33 +00:00
lldb-public.h
lldb-types.h Rename clang_type_t to opaque_compiler_type_t. 2015-09-22 17:04:24 +00:00
lldb-versioning.h Fix a few errors found when building lldb with newer versions of clang. 2013-10-05 02:52:22 +00:00