spin_lock_count-inl.h 871 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #ifndef SPIN_LOCK_COUNT_INL_H_
  3. #error "Direct inclusion of this file is not allowed, include spin_lock_count.h"
  4. #endif
  5. #undef SPIN_LOCK_COUNT_INL_H_
  6. #include "public.h"
  7. #include "spin_lock_base.h"
  8. #ifdef NDEBUG
  9. #include <util/system/compiler.h>
  10. #endif
  11. #include <cstdint>
  12. namespace NYT::NThreading::NPrivate {
  13. ////////////////////////////////////////////////////////////////////////////////
  14. #ifdef NDEBUG
  15. Y_FORCE_INLINE void RecordSpinLockAcquired([[maybe_unused]] bool isAcquired = true)
  16. { }
  17. Y_FORCE_INLINE void RecordSpinLockReleased()
  18. { }
  19. Y_FORCE_INLINE void VerifyNoSpinLockAffinity()
  20. { }
  21. #else
  22. void RecordSpinLockAcquired(bool isAcquired = true);
  23. void RecordSpinLockReleased();
  24. void VerifyNoSpinLockAffinity();
  25. #endif
  26. ////////////////////////////////////////////////////////////////////////////////
  27. } // namespace NYT::NThreading::NPrivate