summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/contrib/test_atomic.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/contrib/test_atomic.c b/tests/contrib/test_atomic.c
index df531c385..702ab71cb 100644
--- a/tests/contrib/test_atomic.c
+++ b/tests/contrib/test_atomic.c
@@ -22,9 +22,16 @@
#include "knot/server/dthreads.h"
#define THREADS 16
-#define CYCLES1 100000
-#define CYCLES2 2000000
-#define CYCLES3 100000
+#if defined(HAVE_C11_ATOMIC) || defined(HAVE_GCC_ATOMIC)
+ #define CYCLES1 100000
+ #define CYCLES2 2000000
+ #define CYCLES3 100000
+#else
+ // Spinlock-emulated atomics. Locking is much slower, enough collisions occur,
+ #define CYCLES1 50000
+ #define CYCLES2 100000
+ #define CYCLES3 100000
+#endif
#define UPPER 0xffffffff00000000
#define LOWER 0x00000000ffffffff
#define UPPER_PTR ((void *) UPPER)