Semaphore import { Semaphore } from "destack:sync"; Counting semaphore. export class Semaphore { state: Atomic; constructor(permits: usize); get availablePermits(): usize; acquire(): SemaphorePermit; tryAcquire(): SemaphorePermit | undefined; acquireMany(count: usize): SemaphorePermit; tryAcquireMany(count: usize): SemaphorePermit | undefined; release(count?: usize): void; } language/library/src/sync/semaphore.ds:7:45 Members state: Atomic The available permit count. constructor(permits: usize) Create a semaphore with permits available permits. get availablePermits(): usize Return the number of immediately available permits. acquire(): SemaphorePermit Acquire one permit, blocking the current Worker if needed. tryAcquire(): SemaphorePermit | undefined Try to acquire one permit without blocking. acquireMany(count: usize): SemaphorePermit Acquire count permits, blocking the current Worker if needed. tryAcquireMany(count: usize): SemaphorePermit | undefined Try to acquire count permits without blocking. release(count?: usize): void Release count permits.