#include <folly/Benchmark.h>
#include <folly/Random.h>
+#include <folly/portability/Asm.h>
#include <folly/portability/GFlags.h>
#include <folly/test/DeterministicSchedule.h>
LifoSem sem;
for (size_t n = 0; n < iters; ++n) {
sem.post();
- asm volatile ("":::"memory");
+ asm_volatile_memory();
}
}
LifoSem sem(iters);
for (size_t n = 0; n < iters; ++n) {
sem.wait();
- asm volatile ("":::"memory");
+ asm_volatile_memory();
}
}
LifoSem sem;
for (size_t n = 0; n < iters; ++n) {
sem.post();
- asm volatile ("":::"memory");
+ asm_volatile_memory();
sem.wait();
- asm volatile ("":::"memory");
+ asm_volatile_memory();
}
}
LifoSem sem;
for (size_t n = 0; n < iters; ++n) {
EXPECT_FALSE(sem.tryWait());
- asm volatile ("":::"memory");
+ asm_volatile_memory();
}
}