Annotate variables with GUARDED_BY in media/gpu/ |
||
Issue descriptionThe 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
,
Sep 17
|
||
►
Sign in to add a comment |
||
Comment 1 by hiroh@chromium.org
, Jul 4