New issue
Advanced search Search tips

Issue 860118 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Annotate variables with GUARDED_BY in media/gpu/

Project Member Reported by hiroh@chromium.org, Jul 4

Issue description

The code in media/gpu/ are likely to use multiple threads.
For example, VDAs have their own thread for decoding. Some variables are touched by multiple threads and they are guarded by lock.
But we don't explicitly comment that for all variables, and then a race condition was caused before.

guarded_by[1], thread annotation, is introduced in Chromium recently. It is used through GUARDED_BY macro in base/thread_annotations.h[2]
It checks a race condition at compile-time. It is useful for the code in media/gpu/.
There are not many usages in Chromium main code at this moment.
I am asking the reason about that in Chromium dev ML [3]. If there is no concern to use the annotation, let's apply it to the code in media/gpu.

[1] https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
[2] https://cs.chromium.org/chromium/src/base/thread_annotations.h
[3] https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/VCeXcGH57s8
 
guarded_by is not compatible with base::AutoLock.
https://bugs.llvm.org/show_bug.cgi?id=36162
This issue is blocked by the bug.
Components: Internals>Media

Sign in to add a comment