sysl

Module

sysl.posix.threads

sysl.threads under the name it had when its threads were pthreads, kept for the programs that import it.

Import import sysl.posix.threads
Requires
requires { libc }, requires { posix }

Write sysl.threads: it is the same API, it asks only for os, and it reaches a kernel’s threads through the hooks of sysl.threads.sys where this name asks for POSIX and a C library the threads no longer need.

Every name here is the one in sysl.threads – the types as aliases, the functions forwarding – so a value made through either module is the other’s.

Index

channel current spawn spawn_on yield_now Channel Condvar Mutex SleepLock Thread

Functions

channel

channel[T](slots: []T) -> Channel[T]

sysl.threads.channel.

current

current() -> Thread

sysl.threads.current.

spawn

spawn[T](body: *extern(*T) -> unit, arg: *T) -> Option[Thread]

sysl.threads.spawn, with the stack it gives a thread where nothing else is asked for.

spawn_on

spawn_on[T](stack: []u8, body: *extern(*T) -> unit, arg: *T) -> Option[Thread]

sysl.threads.spawn_on.

yield_now

yield_now() -> bool

sysl.threads.yield_now.

Aliases

Channel

type Channel[T] = th.Channel[T]

Condvar

type Condvar = th.Condvar

Mutex

type Mutex[T] = th.Mutex[T]

SleepLock

type SleepLock = th.SleepLock

Thread

type Thread = th.Thread

Search

Esc
↑↓ to navigate ↵ to open Esc to close