module vrt.os.thread
Code to support spawning new threads.
The runtime has to be aware of new threads in order to make GC work, so all new threads should be spawned through this interface.
Code Map
//! Code to support spawning new threads.
module vrt.os.thread;
enum EPERM;
enum EAGAIN;
enum EINVAL;
enum EDEADLK;
struct vrt_thread
{
}
struct vrt_mutex
{
}
struct FunctionAdaptor
{
public:
ptr: fn () (void);
public:
fn dgt() { }
}
//! The bottom of the stack.
local __stack_bottom: void*;
fn vrt_mutex_new() vrt_mutex* { }
fn vrt_mutex_trylock(mutex: vrt_mutex*) bool { }
fn vrt_mutex_lock(mutex: vrt_mutex*) bool { }
fn vrt_mutex_unlock(mutex: vrt_mutex*) { }
fn vrt_mutex_delete(mutex: vrt_mutex*) { }
fn vrt_thread_start_fn(func: fn () (void)) vrt_thread* { }
fn vrt_thread_start_dg(dlgt: void delegate()) vrt_thread* { }
fn vrt_thread_error(t: vrt_thread*) bool { }
fn vrt_thread_error_message(t: vrt_thread*) string { }
fn vrt_thread_join(t: vrt_thread*) { }
fn vrt_sleep(ms: u32) { }
fn vrt_get_stack_bottom() void* { }
local __stack_bottom: void*
The bottom of the stack.
Initialised by vrt_gc_find_stack_bottom function, called in the main function generated by the compiler.