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
7 // Some environments provide custom macros to aid in static thread-safety
8 // analysis. Provide empty definitions of such macros unless they are already
11 #ifndef EXCLUSIVE_LOCKS_REQUIRED
12 #define EXCLUSIVE_LOCKS_REQUIRED(...)
15 #ifndef SHARED_LOCKS_REQUIRED
16 #define SHARED_LOCKS_REQUIRED(...)
19 #ifndef LOCKS_EXCLUDED
20 #define LOCKS_EXCLUDED(...)
24 #define LOCK_RETURNED(x)
31 #ifndef SCOPED_LOCKABLE
32 #define SCOPED_LOCKABLE
35 #ifndef EXCLUSIVE_LOCK_FUNCTION
36 #define EXCLUSIVE_LOCK_FUNCTION(...)
39 #ifndef SHARED_LOCK_FUNCTION
40 #define SHARED_LOCK_FUNCTION(...)
43 #ifndef EXCLUSIVE_TRYLOCK_FUNCTION
44 #define EXCLUSIVE_TRYLOCK_FUNCTION(...)
47 #ifndef SHARED_TRYLOCK_FUNCTION
48 #define SHARED_TRYLOCK_FUNCTION(...)
51 #ifndef UNLOCK_FUNCTION
52 #define UNLOCK_FUNCTION(...)
55 #ifndef NO_THREAD_SAFETY_ANALYSIS
56 #define NO_THREAD_SAFETY_ANALYSIS
59 #endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H