aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2020-02-21 16:45:29 -0800
committerJim Ingham <jingham@apple.com>2020-02-25 11:17:08 -0800
commit3cd13c4624b5900c884b691b72d0ca053433f6fe (patch)
tree3db2d214e4e6e047baf1d1af55e9811ab5081729 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
parent481b1c83802f730df5876d01ede2054a738ee37e (diff)
downloadllvm-3cd13c4624b5900c884b691b72d0ca053433f6fe.zip
llvm-3cd13c4624b5900c884b691b72d0ca053433f6fe.tar.gz
llvm-3cd13c4624b5900c884b691b72d0ca053433f6fe.tar.bz2
Fix a race between lldb's packet timeout and the profile thread's usleep.
The debugserver profile thread used to suspend itself between samples with a usleep. When you detach or kill, MachProcess::Clear would delay replying to the incoming packet until pthread_join of the profile thread returned. If you are unlucky or the suspend delay is long, it could take longer than the packet timeout for pthread_join to return. Then you would get an error about detach not succeeding from lldb - even though in fact the detach was successful... I replaced the usleep with PThreadEvents entity. Then we just call a timed WaitForEventBits, and when debugserver wants to stop the profile thread, it can set the event bit, and the sleep will exit immediately. Differential Revision: https://reviews.llvm.org/D75004
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
0 files changed, 0 insertions, 0 deletions