1 // Copyright (c) 2012 The LevelDB Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. See the AUTHORS file for names of contributors.
5 #ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_
6 #define STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_
8 // Some environments provide custom macros to aid in static thread-safety
9 // analysis. Provide empty definitions of such macros unless they are already
12 #ifndef EXCLUSIVE_LOCKS_REQUIRED
13 #define EXCLUSIVE_LOCKS_REQUIRED(...)
16 #ifndef SHARED_LOCKS_REQUIRED
17 #define SHARED_LOCKS_REQUIRED(...)
20 #ifndef LOCKS_EXCLUDED
21 #define LOCKS_EXCLUDED(...)
25 #define LOCK_RETURNED(x)
32 #ifndef SCOPED_LOCKABLE
33 #define SCOPED_LOCKABLE
36 #ifndef EXCLUSIVE_LOCK_FUNCTION
37 #define EXCLUSIVE_LOCK_FUNCTION(...)
40 #ifndef SHARED_LOCK_FUNCTION
41 #define SHARED_LOCK_FUNCTION(...)
44 #ifndef EXCLUSIVE_TRYLOCK_FUNCTION
45 #define EXCLUSIVE_TRYLOCK_FUNCTION(...)
48 #ifndef SHARED_TRYLOCK_FUNCTION
49 #define SHARED_TRYLOCK_FUNCTION(...)
52 #ifndef UNLOCK_FUNCTION
53 #define UNLOCK_FUNCTION(...)
56 #ifndef NO_THREAD_SAFETY_ANALYSIS
57 #define NO_THREAD_SAFETY_ANALYSIS
60 #endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_