Skip to content

WaitQueue

Defined in: src/wait.ts:11

Somewhere for tasks to sleep until something happens, i.e. wait_queue_head_t.

Nothing here actually sleeps a thread: the process is already blocked on the shared page while the kernel works, so a waiter is just a promise the kernel holds until whatever it is waiting on wakes it.

new WaitQueue(): WaitQueue

WaitQueue

protected readonly waiters: Set<() => void>

Defined in: src/wait.ts:12

get waiting(): number

Defined in: src/wait.ts:14

number

wait(): Promise<void>

Defined in: src/wait.ts:19

Sleep until something wakes the queue, i.e. add_wait_queue and then schedule

Promise<void>


wait_with(waiter): () => void

Defined in: src/wait.ts:35

Wake up a waiter, i.e. add_wait_queue and remove_wait_queue around one sleep.

() => void

a function that stops waiting without the queue having been woken

() => void


wake_up(): void

Defined in: src/wait.ts:41

Wake everything on the queue, i.e. wake_up

void