Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: When performing a synchronous resume, the API mutex is held until the process is stopped. This is fine, except for when the OS plugins are processing an event before the main thread is aware of it, in which case we end up with a deadlock because in the internal thread we acquire a resource lock first, and then wait for the API lock, while in the main thread we do the opposite, we already hold the API mutex but are now waiting for the event mutex to handle the event. This patch fixes this by relaxing the need for the API lock in the OS plugins. We can get away with this because we now this code is executed in the main thread. As stated in the comment above, we just want to ensure nobody else messes with the API while we're making a change. In theory it's possible that the main thread would release the lock while we're executing the function, but prevent this would require a more structural solution (which we want, but do not have today). The same workaround was already present, but this patch generalizes it to the whole file. This will allow me to re-land r329891. Reviewers: clayborg, jingham, labath Subscribers: llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D45586 llvm-svn: 330002
- Loading branch information
1 parent
c006593
commit 85a5ec5
Showing
1 changed file
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters