• Yi Gu's avatar
    Revert "[MessageLoop] Lock-free ScheduleWork() scheme" · 243f975c
    Yi Gu authored
    This reverts commit f7da13a2.
    
    Reason for revert: As per comments by Findit
    
    Original change's description:
    > [MessageLoop] Lock-free ScheduleWork() scheme
    > 
    > The Lock is causing hangs because of priority inversion
    > mixed with priority boosting (ScheduleWork() tends to
    > boost the destination thread which may deschedule the
    > posting thread; if the posting thread is a background
    > thread this boost-induded-desched-while-holding-lock
    > can cause a livelock). See https://crbug.com/890978#c10
    > for example crashes catching this.
    > 
    > The Lock was only necessary for startup/shutdown and is
    > being replaced by a lock-free atomic scheme in this CL.
    > 
    > MessagePump::ScheduleWork() itself was already thread-safe
    > (but the Android impl did unnecessarily check a non-atomic bool)
    > 
    > This adds a WaitableEvent in ~MessageLoop(); hence the requirement
    > for a wait-allowance in net's EmbeddedTestServer.
    > 
    > TBR=zhongyi@chromium.org (embedded_test_server.cc side-effects)
    > 
    > Bug: 890978, 874237
    > Change-Id: I0916e5a99035a935b0a23a770af256f334e78c43
    > Reviewed-on: https://chromium-review.googlesource.com/c/1278631
    > Commit-Queue: Gabriel Charette <gab@chromium.org>
    > Reviewed-by: François Doray <fdoray@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#601600}
    
    TBR=gab@chromium.org,fdoray@chromium.org,zhongyi@chromium.org
    
    Change-Id: I521ef6ba2758f84d13a4f98d65cb41b276cb115e
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 890978, 874237
    Reviewed-on: https://chromium-review.googlesource.com/c/1294717Reviewed-by: default avatarYi Gu <yigu@chromium.org>
    Commit-Queue: Yi Gu <yigu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#601731}
    243f975c
message_loop.h 17.7 KB