• xhwang's avatar
    Avoid deadlock between Pipeline and RendererImpl. · 7def98aa
    xhwang authored
    Both Pipeline and RendererImpl use it's own lock. We could end up with a dead
    lock in the following scenario:
    - On main thread, Pipeline holds it's lock (lock A) and calls into RendererImpl,
      which also requires the RendererImpl's lock (lock B).
    - On media thread, RendererImpl holds it's lock B and calls callback provided by
      the Pipeline, which requires lock A.
    
    This CL makes sure Pipeline never calls into RendererImpl while holding lock A
    and RendererImpl nevers calls (back) into Pipeline while holding lock B. So
    deadlock should not happen.
    
    This CL also reverts 3 CLs that disabled various tests due to the bug:
    - Revert "Exclude tests that deadlock under DrMemory (and Tsan)"
       This reverts commit 0e014b9a.
    - Revert "Disable deadlock-y tests in TSan instead of just suppressing the error."
       This reverts commit f712d106.
    - Revert "Suppress a deadlock report through media::Pipeline::GetMediaTime."
       This reverts commit 5c72e0f6.
    
    BUG=407452
    TEST=Ran PipelineIntegrationTest.ChunkDemuxerAbortRead_VideoOnly in a TSAN build for 10 mins and didn't see any issue.
    
    Review URL: https://codereview.chromium.org/512973002
    
    Cr-Commit-Position: refs/heads/master@{#292332}
    7def98aa
pipeline.cc 19.4 KB