Commit 1e3ecfea authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/V4L2VDA: Fix sequence check failing in device poller on shutdown.

This CL fixes a sequence check failing when destroying the device
poller. This can happen when a video decoder is destroyed before
initialization, causing destruction to not be performed on the video
decoder thread as it was never started.

TEST=./video_decode_accelerator_tests on hana

BUG=b:150650090

Change-Id: I3f014c70cc5e7ffdd54d706a93ad12e014189a88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2084672
Commit-Queue: David Staessens <dstaessens@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748156}
parent e93db5a1
...@@ -25,8 +25,11 @@ V4L2DevicePoller::V4L2DevicePoller(V4L2Device* const device, ...@@ -25,8 +25,11 @@ V4L2DevicePoller::V4L2DevicePoller(V4L2Device* const device,
} }
V4L2DevicePoller::~V4L2DevicePoller() { V4L2DevicePoller::~V4L2DevicePoller() {
DCHECK_CALLED_ON_VALID_SEQUENCE(client_sequence_checker_); // It's possible the V4L2 device poller gets destroyed on a different thread
// than expected if e.g. destroying a decoder immediately after creation. The
// check here is not thread-safe, but using a lock or atomic state doesn't
// make sense as destruction is never thread-safe.
if (poll_thread_.IsRunning())
StopPolling(); StopPolling();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment