remove \r
[extl.git] / extl / synch / synch_traits.h
blobdfaeaece1b55eaf81225dc61edcb68b54a6234fc
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: synch_traits.h
4 * Created: 08.05.15
5 * Updated: 08.05.15
7 * Brief: synch_traits class
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_SYNCH_SYNCH_TRAITS_H
13 #define EXTL_SYNCH_SYNCH_TRAITS_H
15 /*!\file synch_traits.h
16 * \brief synch_traits class
18 * L = null_lock: Uses atomic functions
19 * L != null_lock: Uses lock
21 #ifndef __cplusplus
22 # error synch_traits.h need be supported by c++.
23 #endif
25 /* ///////////////////////////////////////////////////////////////////////
26 * Includes
28 #include "atomic_traits.h"
29 #include "../platform/synch/lock_selector.h"
30 /* ///////////////////////////////////////////////////////////////////////
31 * ::extl namespace
33 EXTL_BEGIN_NAMESPACE
35 /*\brief synch_traits class
37 * \param L The lock type
38 * \param A The atomic traits type
40 * \ingroup extl_group_synch
42 template< typename_param_k L
43 , typename_param_k A
45 struct synch_traits
47 /// \name Types
48 /// @{
49 typedef L lock_type;
50 typedef A atomic_traits_type;
51 /// @}
54 /// Single thread synchronous traits
55 typedef synch_traits<null_lock, atomic_traits<e_false_v> > single_thread_synch_traits;
57 /// Multiple thread synchronous traits
58 typedef synch_traits< EXTL_NS_PLATFORM(lock_selector)::lock_type
59 , atomic_traits<e_true_v>
60 > multi_thread_synch_traits;
62 /* ///////////////////////////////////////////////////////////////////////
63 * ::extl namespace
65 EXTL_END_NAMESPACE
67 /* //////////////////////////////////////////////////////////////////// */
68 #endif /* EXTL_SYNCH_SYNCH_TRAITS_H */
69 /* //////////////////////////////////////////////////////////////////// */