Added warnings for deprecated .h files
[libcds.git] / cds / lock / spinlock.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_LOCK_SPINLOCK_H
4 #define __CDS_LOCK_SPINLOCK_H
5
6 #if CDS_COMPILER == CDS_COMPILER_MSVC
7 #   pragma message("cds/lock/spinlock.h is deprecated, use cds/sync/spinlock.h instead")
8 #else
9 #   warning "cds/lock/spinlock.h is deprecated, use cds/sync/spinlock.h instead"
10 #endif
11
12 #include <cds/sync/spinlock.h>
13
14 //@cond
15 namespace cds {
16     /// Synchronization primitives (deprecated namespace, use \p cds::sync namespace instead)
17     namespace lock {
18
19         /// Alias for \p cds::sync::spin_lock for backward compatibility
20         template <typename Backoff>
21         using Spinlock = cds::sync::spin_lock< Backoff >;
22
23         /// Spin-lock implementation default for the current platform
24         typedef cds::sync::spin_lock< backoff::LockDefault> Spin;
25
26         /// Alias for \p cds::sync::reentrant_spin_lock for backward compatibility
27         template <typename Integral, class Backoff>
28         using ReentrantSpinT = cds::sync::reentrant_spin_lock< Integral, Backoff >;
29
30         /// Recursive 32bit spin-lock
31         typedef cds::sync::reentrant_spin32 ReentrantSpin32;
32
33         /// Recursive 64bit spin-lock
34         typedef cds::sync::reentrant_spin64 ReentrantSpin64;
35
36         /// Default recursive spin-lock type
37         typedef ReentrantSpin32 ReentrantSpin;
38
39     }    // namespace lock
40
41     /// Standard (best for the current platform) spin-lock implementation
42     typedef lock::Spin              SpinLock;
43
44     /// Standard (best for the current platform) recursive spin-lock implementation
45     typedef lock::ReentrantSpin     RecursiveSpinLock;
46
47     /// 32bit recursive spin-lock shortcut
48     typedef lock::ReentrantSpin32   RecursiveSpinLock32;
49
50     /// 64bit recursive spin-lock shortcut
51     typedef lock::ReentrantSpin64   RecursiveSpinLock64;
52
53 } // namespace cds
54 //@endcond
55
56 #endif  // #ifndef __CDS_LOCK_SPINLOCK_H