File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,7 @@ class CouchbaseAtomic {
81
81
82
82
void store (const T &newValue, memory_order sync = memory_order_acq_rel) {
83
83
(void ) sync;
84
- value = newValue;
85
- ep_sync_synchronize ();
84
+ ep_sync_lock_test_and_set (&value, newValue);
86
85
}
87
86
88
87
Original file line number Diff line number Diff line change @@ -62,6 +62,17 @@ static void testAtomicInt() {
62
62
cb_assert (intgen.latest () == (numThreads * numIterations));
63
63
}
64
64
65
+ static void testAtomicUint64 () {
66
+ // Check that we can correctly load / store from values larger than 32bits.
67
+ AtomicValue<uint64_t > value;
68
+ uint64_t expected_val = 1ul << 33 ;
69
+ value.store (expected_val);
70
+ cb_assert (value == expected_val);
71
+
72
+ value.store (0 );
73
+ cb_assert (value == 0 );
74
+ }
75
+
65
76
static void testSetIfLess () {
66
77
AtomicValue<int > x;
67
78
@@ -127,6 +138,7 @@ int testAtomicCompareExchangeStrong(void) {
127
138
int main () {
128
139
alarm (60 );
129
140
testAtomicInt ();
141
+ testAtomicUint64 ();
130
142
testSetIfLess ();
131
143
testSetIfBigger ();
132
144
testAtomicDouble ();
You can’t perform that action at this time.
0 commit comments