Skip to main content
Log in

Mojo struct

Semaphore

@register_passable struct Semaphore

Implemented traits

AnyType, UnknownDestructibility

Methods

__init__

__init__(lock: UnsafePointer[SIMD[int32, 1]], thread_id: Int) -> Self

fetch

fetch(mut self)

state

state(self) -> SIMD[int32, 1]

wait

wait(mut self, status: Int = 0)

release

release(mut self, status: SIMD[int32, 1] = SIMD(0))