[Lldb-commits] [PATCH][Review Request] Fix for potentially missed events in Core/Listener

Greg Clayton gclayton at apple.com
Mon Nov 12 15:15:51 PST 2012


% svn commit 
Sending        source/Core/Listener.cpp
Transmitting file data .
Committed revision 167778.

On Nov 12, 2012, at 2:20 PM, "Kaylor, Andrew" <andrew.kaylor at intel.com> wrote:

> Ping (with refreshed patch)
>  
> From: lldb-commits-bounces at cs.uiuc.edu [mailto:lldb-commits-bounces at cs.uiuc.edu] On Behalf Of Kaylor, Andrew
> Sent: Friday, October 26, 2012 12:38 PM
> To: lldb-commits at cs.uiuc.edu
> Subject: [Lldb-commits] [PATCH][Review Request] Fix for potentially missed events in Core/Listener
>  
> This patch fixes a problem where the Listener class could get into a deadlocked state because it missed the arrival of a new event.  It was possible for a new event to arrive between the time Listener::WaitForEventsInternal checked the list of available events and the time it set the conditional variable indicating that the event it was waiting for was not available.  The patch closes this loophole by locking the m_events_mutex before calling Listener::FindNextEventInternal and holding it until after it sets the condition variable.
>  
> In addition, I am removing the explicit Unlock in Listener::FindNextEventInternal because with the change above the calling function holds the mutex so it will not actually be unlocked.  The only potential problem I can see with this is if some implementation of Event::DoOnRemoval blocks waiting for an event to be received from another thread by the calling Listener object (which seems like a bad idea).
>  
> -Andy
> <listener-fix.patch>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list