New issue
Advanced search Search tips

Issue 881903 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 831825
Owner: ----
Closed: Sep 12
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

EXCLUSIVE_TRYLOCK_FUNCTION / etc. base::Lock methods

Project Member Reported by lukasza@chromium.org, Sep 7

Issue description

Issue 881875 tracks adding minimal annotations to base::Lock and base::AutoLock that would enable adding GUARDED_BY annotations and enforcements for fields protected by base::AutoLock.  Such minimal annotations are insufficient for

1. base::AutoLock(..., base::AutoLock::AlreadyAcquired()) constructor which will trigger compiler errors until base::Lock::Try is annotated with EXCLUSIVE_TRYLOCK_FUNCTION.

2. Analysing and enforcing direct usage of base::Lock methods.


Let's use this bug to track annotating Lock methods as follows:

  void Acquire() EXCLUSIVE_LOCK_FUNCTION();
  void Release() UNLOCK_FUNCTION();
  bool Try() EXCLUSIVE_TRYLOCK_FUNCTION(true);
  void AssertAcquired() const ASSERT_EXCLUSIVE_LOCK();
 
Mergedinto: 831825
Status: Duplicate (was: Untriaged)

Sign in to add a comment