Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
0.2.0 Preview 1 · Frozen documentation

AsyncMutexGuard

Retains exclusive writable payload access across suspension and worker resume. No OS-thread affinity; cleanup returns exactly one permit before releasing state. Noncopy, move-only, not move-assignable. References expire at move/destruction; independently retaining the owner cannot authorize access after guard release.

Sn is under heavy development. Reference extracted from this release’s bundled standard library. Public API examples are not an exhaustive compatibility test. Read the matching release guide for tested workflows and limitations. Read the status →

Module std.sync

import std.sync;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

AsyncMutexGuard

pub final class AsyncMutexGuard<T> where T: Movable

Retains exclusive writable payload access across suspension and worker resume. No OS-thread affinity; cleanup returns exactly one permit before releasing state. Noncopy, move-only, not move-assignable. References expire at move/destruction; independently retaining the owner cannot authorize access after guard release. T: Movable payload.

AsyncMutexGuard.init

pub init(Source: readonly Self&) = delete;

Rejects duplicate release authority. Source: Existing guard.

AsyncMutexGuard.init

pub init(Source: mut Self&&)

Transfers guard authority; moved source is inert. Source: Transferred guard.

AsyncMutexGuard.operator

pub fn operator =(Source: readonly Self&) -> void = delete;

Rejects duplicate release authority. Source: Existing guard. Return: No runtime result; this assignment is deleted and cannot be invoked.

AsyncMutexGuard.operator

pub fn operator =(Source: mut Self&&) -> void = delete;

Rejects replacing an active scoped guard. Source: Existing guard. Return: No runtime result; this assignment is deleted and cannot be invoked.

AsyncMutexGuard.IsEmpty

pub IsEmpty: bool;

Observes moved/inert authority.

AsyncMutexGuard.Value

pub readonly fn Value() -> readonly T&

Borrows readonly access under retained exclusive ownership. Return: Reference expiring at guard move/destruction.

AsyncMutexGuard.Value

pub fn Value() -> mut T&

Borrows writable access under retained exclusive ownership. Return: Reference expiring at guard move/destruction.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library