projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make folly pass TSAN checks
[folly.git]
/
folly
/
test
/
SmallLocksTest.cpp
diff --git
a/folly/test/SmallLocksTest.cpp
b/folly/test/SmallLocksTest.cpp
index 1618b9f957d522559fcd4e8dbec9065e6937a672..9da8b2bd098c223e7cec110878fd0b41b8199a50 100644
(file)
--- a/
folly/test/SmallLocksTest.cpp
+++ b/
folly/test/SmallLocksTest.cpp
@@
-93,7
+93,7
@@
template<class T> struct PslTest {
void doTest() {
using UT = typename std::make_unsigned<T>::type;
T ourVal = rand() % T(UT(1) << (sizeof(UT) * 8 - 1));
void doTest() {
using UT = typename std::make_unsigned<T>::type;
T ourVal = rand() % T(UT(1) << (sizeof(UT) * 8 - 1));
- for (int i = 0; i < 100
00
; ++i) {
+ for (int i = 0; i < 100; ++i) {
std::lock_guard<PicoSpinLock<T>> guard(lock);
lock.setData(ourVal);
for (int n = 0; n < 10; ++n) {
std::lock_guard<PicoSpinLock<T>> guard(lock);
lock.setData(ourVal);
for (int n = 0; n < 10; ++n) {
@@
-231,9
+231,9
@@
TEST(SmallLocks, MicroLock) {
// affect bits outside the ones MicroLock is defined to affect.
struct {
uint8_t a;
// affect bits outside the ones MicroLock is defined to affect.
struct {
uint8_t a;
-
volatile uint8_t
b;
+
std::atomic<uint8_t>
b;
MicroLock alock;
MicroLock alock;
-
volatile uint8_t
d;
+
std::atomic<uint8_t>
d;
} x;
uint8_t origB = 'b';
} x;
uint8_t origB = 'b';