1 /* ///////////////////////////////////////////////////////////////////////
7 * Brief: synch_traits class
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
22 # error synch_traits.h need be supported by c++.
25 /* ///////////////////////////////////////////////////////////////////////
28 #include "atomic_traits.h"
29 #include "../platform/synch/lock_selector.h"
30 /* ///////////////////////////////////////////////////////////////////////
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
50 typedef A atomic_traits_type
;
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 /* ///////////////////////////////////////////////////////////////////////
67 /* //////////////////////////////////////////////////////////////////// */
68 #endif /* EXTL_SYNCH_SYNCH_TRAITS_H */
69 /* //////////////////////////////////////////////////////////////////// */