File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 6
6
#include < limits>
7
7
#include < type_traits>
8
8
#include < utility>
9
+ #include < cstdint>
9
10
10
11
// //////////////////////////////////////////////////////////////
11
12
// / Gives hint to processor that improves performance of spin-wait loops.
@@ -98,7 +99,7 @@ inline void sleep(K& k) {
98
99
namespace ipc {
99
100
100
101
class spin_lock {
101
- std::atomic<unsigned > lc_ { 0 };
102
+ std::atomic<std:: uint32_t > lc_ { 0 };
102
103
103
104
public:
104
105
void lock (void ) noexcept {
@@ -113,13 +114,13 @@ class spin_lock {
113
114
};
114
115
115
116
class rw_lock {
116
- using lc_ui_t = unsigned ;
117
+ using lc_ui_t = std:: uint32_t ;
117
118
118
119
std::atomic<lc_ui_t > lc_ { 0 };
119
120
120
121
enum : lc_ui_t {
121
- w_mask = (std::numeric_limits<std::make_signed_t <lc_ui_t >>::max)(), // b 0111 1111
122
- w_flag = w_mask + 1 // b 1000 0000
122
+ w_mask = (std::numeric_limits<std::make_signed_t <lc_ui_t >>::max)(), // b 0111 1111 ...
123
+ w_flag = w_mask + 1 // b 1000 0000 ...
123
124
};
124
125
125
126
public:
You can’t perform that action at this time.
0 commit comments