| // Copyright 2026 The Fuchsia Authors. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library zx; |
| |
| @transport("Syscall") |
| closed protocol Membarrier { |
| /// ## Summary |
| /// |
| /// Issue a data membarrier on all running threads within this process. |
| /// |
| /// ## Declaration |
| /// |
| /// ```c |
| /// #include <zircon/syscalls.h> |
| /// |
| /// void zx_membarrier_sync_process_data(void); |
| /// ``` |
| /// |
| /// ## Description |
| /// |
| /// Issues a data membarrier on all running threads within this process. |
| /// When this call returns, all running threads in the system that share a |
| /// futex domain with the calling thread will pass through a state where |
| /// all data memory accesses are synchronized. |
| /// |
| /// ## Rights |
| /// |
| /// This operation does not require any rights. |
| /// |
| strict SyncProcessData(); |
| |
| /// ## Summary |
| /// |
| /// Issue an instruction membarrier on all running threads within this |
| /// process. |
| /// |
| /// ## Declaration |
| /// |
| /// ```c |
| /// #include <zircon/syscalls.h> |
| /// |
| /// void zx_membarrier_sync_process_insn(void); |
| /// ``` |
| /// |
| /// ## Description |
| /// |
| /// Issues a instruction stream membarrier on all running threads within |
| /// this process. When this call returns, all running threads in the system |
| /// that share a futex domain with the calling thread will pass through a |
| /// state where all instruction stream and data memory accesses are |
| /// synchronized. |
| /// |
| /// ## Rights |
| /// |
| /// This operation does not require any rights. |
| /// |
| strict SyncProcessInsn(); |
| }; |