Annotate base::Lock with thread-safety annotations |
|||
Issue descriptionDoing this introduces a bunch of warnings in not-yet-annotated code.
,
Apr 11 2018
On a related note, annotating ScopedUnlock is blocked on https://bugs.llvm.org/show_bug.cgi?id=36162. Mentioning it here because the bug reference is currently buried deep in a chromium-dev thread.
,
Apr 12 2018
@dcheng: don't we need to support ScopedUnlock first? Otherwise we'll end up with a bunch of false positive warnings?
,
Apr 12 2018
I tried building today and I "only" got a few hundred lines of warnings or so. So maybe it won't be that bad? I was thinking of just suppressing those warnings for now. Also, AutoUnlock is rarer, relatively speaking, so I think it ought to be OK.
,
Apr 12 2018
How do suppressions work? I agree that AutoUnlock is rare but it also shouldn't be a pain to add one to a lock that is already widely used without one (i.e. ok if warning is local, annoying if warning spreads to all existing usages of that Lock). In any case, a hundred warnings, ouch! I'm not that surprised but I would have ballparked ≈30, not hundreds! Also enabling these annotations allows us to get rid of crazy things I did in the past to lock in fixes to locking paradigms (e.g. safe_browsing::DatabaseStateManager::ThreadSafeStateManager)..!
,
Apr 12 2018
I think NO_THREAD_SAFETY_ANALYSIS should suppress analysis in the scope where AutoUnlock is used--though we'd probably want to label it something AutoUnlock specific to make it easy to cleanup later.
,
Sep 12
,
Sep 12
,
Sep 20
,
Sep 26
|
|||
►
Sign in to add a comment |
|||
Comment 1 by dcheng@chromium.org
, Apr 11 2018