Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
futex.hpp File Reference

Cross-platform futex-like synchronization primitives. More...

#include <cstdint>
#include <ctime>
#include <cerrno>
#include <linux/futex.h>
#include <sys/syscall.h>
#include <unistd.h>

Go to the source code of this file.

Namespaces

namespace  bb
 Entry point for Barretenberg command-line interface.
 
namespace  bb::ipc
 

Functions

int bb::ipc::futex_wait (volatile uint32_t *addr, uint32_t expect)
 Atomic compare-and-wait operation.
 
int bb::ipc::futex_wait_timeout (volatile uint32_t *addr, uint32_t expect, uint64_t timeout_ns)
 Atomic compare-and-wait operation with timeout.
 
int bb::ipc::futex_wake (volatile uint32_t *addr, int n)
 Wake waiters blocked on an address.
 

Detailed Description

Cross-platform futex-like synchronization primitives.

Provides unified wait/wake operations for cross-process synchronization:

  • macOS: Uses os_sync_wait_on_address / os_sync_wake_by_address_any
  • Linux: Uses futex syscalls

Definition in file futex.hpp.