aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/threading/spin_lock_count-inl.h
blob: 196f833a87a738fa07397b23661d833fe8c87bea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#ifndef SPIN_LOCK_COUNT_INL_H_
#error "Direct inclusion of this file is not allowed, include spin_lock_count.h"
#endif
#undef SPIN_LOCK_COUNT_INL_H_

#include "public.h"
#include "spin_lock_base.h"

#ifdef NDEBUG
#include <util/system/compiler.h>
#endif

#include <cstdint>

namespace NYT::NThreading::NPrivate {

////////////////////////////////////////////////////////////////////////////////

#ifdef NDEBUG

Y_FORCE_INLINE void RecordSpinLockAcquired([[maybe_unused]] bool isAcquired = true)
{ }

Y_FORCE_INLINE void RecordSpinLockReleased()
{ }

Y_FORCE_INLINE void VerifyNoSpinLockAffinity()
{ }

#else

void RecordSpinLockAcquired(bool isAcquired = true);
void RecordSpinLockReleased();
void VerifyNoSpinLockAffinity();

#endif

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT::NThreading::NPrivate