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