*/
#define _LGPL_SOURCE
+#include "futex.hpp"
+
+#include <common/common.hpp>
+
#include <limits.h>
#include <unistd.h>
#include <urcu.h>
#include <urcu/futex.h>
-#include <common/common.hpp>
-
-#include "futex.hpp"
-
/*
* This futex wait/wake scheme only works for N wakers / 1 waiters. Hence the
* "nto1" added to all function signature.
{
if (active) {
uatomic_set(futex, 1);
- if (futex_async(futex, FUTEX_WAKE,
- INT_MAX, NULL, NULL, 0) < 0) {
+ if (futex_async(futex, FUTEX_WAKE, INT_MAX, nullptr, nullptr, 0) < 0) {
PERROR("futex_async");
abort();
}
cmm_smp_mb();
while (uatomic_read(futex) == -1) {
- if (!futex_async(futex, FUTEX_WAIT, -1, NULL, NULL, 0)) {
+ if (!futex_async(futex, FUTEX_WAIT, -1, nullptr, nullptr, 0)) {
/*
* Prior queued wakeups queued by unrelated code
* using the same address can cause futex wait to
goto end;
case EINTR:
/* Retry if interrupted by signal. */
- break; /* Get out of switch. Check again. */
+ break; /* Get out of switch. Check again. */
default:
/* Unexpected error. */
PERROR("futex_async");
if (caa_unlikely(uatomic_read(futex) != -1))
goto end;
uatomic_set(futex, 0);
- if (futex_async(futex, FUTEX_WAKE, 1, NULL, NULL, 0) < 0) {
+ if (futex_async(futex, FUTEX_WAKE, 1, nullptr, nullptr, 0) < 0) {
PERROR("futex_async");
abort();
}