Skip to main content

Module semaphore

Module semaphore 

Source
Expand description

Port of std.Thread.Semaphore (Zig 0.14.1) on top of Bun’s Mutex + Condition. A semaphore is an unsigned integer that blocks the calling thread when it would go negative.

Supports const fn new() static initialization and needs no deinit. Only the subset Bun uses is ported (wait/post); timedWait is omitted because no Rust caller needs it and it would pull in a monotonic timer.

Structs§

Semaphore