add absl annotations

pull/953/head
Jeff Becker 5 years ago
parent fe6783eef6
commit 8ceb20452a
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -75,8 +75,7 @@ namespace llarp
/// a lock that does nothing
struct SCOPED_LOCKABLE NullLock
{
NullLock(ABSL_ATTRIBUTE_UNUSED const NullMutex* mtx)
EXCLUSIVE_LOCK_FUNCTION(mtx)
NullLock(const NullMutex* mtx) EXCLUSIVE_LOCK_FUNCTION(mtx)
{
mtx->lock();
}
@ -162,14 +161,14 @@ namespace llarp
{
template < typename F >
void
TryAccess(F visit) const
TryAccess(F visit) const LOCKS_EXCLUDED(_access)
{
NullLock lock(&__access);
NullLock lock(&_access);
visit();
}
private:
mutable NullMutex __access;
mutable NullMutex _access;
};
} // namespace util
} // namespace llarp

Loading…
Cancel
Save