thread_annotations.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.
  4. #ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_
  5. #define STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_
  6. // Some environments provide custom macros to aid in static thread-safety
  7. // analysis. Provide empty definitions of such macros unless they are already
  8. // defined.
  9. #ifndef EXCLUSIVE_LOCKS_REQUIRED
  10. #define EXCLUSIVE_LOCKS_REQUIRED(...)
  11. #endif
  12. #ifndef SHARED_LOCKS_REQUIRED
  13. #define SHARED_LOCKS_REQUIRED(...)
  14. #endif
  15. #ifndef LOCKS_EXCLUDED
  16. #define LOCKS_EXCLUDED(...)
  17. #endif
  18. #ifndef LOCK_RETURNED
  19. #define LOCK_RETURNED(x)
  20. #endif
  21. #ifndef LOCKABLE
  22. #define LOCKABLE
  23. #endif
  24. #ifndef SCOPED_LOCKABLE
  25. #define SCOPED_LOCKABLE
  26. #endif
  27. #ifndef EXCLUSIVE_LOCK_FUNCTION
  28. #define EXCLUSIVE_LOCK_FUNCTION(...)
  29. #endif
  30. #ifndef SHARED_LOCK_FUNCTION
  31. #define SHARED_LOCK_FUNCTION(...)
  32. #endif
  33. #ifndef EXCLUSIVE_TRYLOCK_FUNCTION
  34. #define EXCLUSIVE_TRYLOCK_FUNCTION(...)
  35. #endif
  36. #ifndef SHARED_TRYLOCK_FUNCTION
  37. #define SHARED_TRYLOCK_FUNCTION(...)
  38. #endif
  39. #ifndef UNLOCK_FUNCTION
  40. #define UNLOCK_FUNCTION(...)
  41. #endif
  42. #ifndef NO_THREAD_SAFETY_ANALYSIS
  43. #define NO_THREAD_SAFETY_ANALYSIS
  44. #endif
  45. #endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_