[Lldb-commits] [PATCH] D133410: [lldb] Fix ThreadedCommunication races

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 7 02:43:59 PDT 2022


labath created this revision.
labath added reviewers: mgorny, JDevlieghere.
Herald added a project: All.
labath requested review of this revision.
Herald added a project: LLDB.

The Read function could end up blocking if data (or EOF) arrived just as
it was about to start waiting for the events. This was only discovered
now, because we did not have unit tests for this functionality before.
We need to check for data *after* we start listening for incoming
events. There were no changes to the read thread code needed, as we
already use this pattern in SynchronizeWithReadThread, so I just updated
the comments to make it clear that it is used for reading as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133410

Files:
  lldb/source/Core/ThreadedCommunication.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133410.458402.patch
Type: text/x-patch
Size: 3895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220907/d0bc96ff/attachment.bin>


More information about the lldb-commits mailing list