Thread State

An Idio thread holds various elements of state about a thread of execution.

From a user’s perspective it maintains the concepts of the current input, output and error handles and the current module.

Thread Accessors

function current-error-handle

Return the current error handle

Return:

current error handle

Rtype:

handle

function current-input-handle

Return the current input handle

Return:

current input handle

Rtype:

handle

function current-output-handle

Return the current output handle

Return:

current output handle

Rtype:

handle

function set-input-handle! handle

Set the current input handle to handle

Param handle:

handle to use

Type handle:

handle

Return:

#<unspec>

function set-output-handle! handle

Set the current output handle to handle

Param handle:

handle to use

Type handle:

handle

Return:

#<unspec>

function set-error-handle! handle

Set the current error handle to handle

Param handle:

handle to use

Type handle:

handle

Return:

#<unspec>

function current-module

Return the current module

Return:

current module

Rtype:

module

function idio-thread-state [args]

Display a dump of the current thread’s state

Return:

#<unspec>

function run-in-thread thr thunk

Run thunk in thread thr.

Param thr:

the thread

Type thr:

thread

Param thunk:

a thunk

Type thunk:

function

function %%vm-trace level [file [mode]]

set VM tracing to level for user code

Param level:

new VM tracing level

Type level:

fixnum

Param file:

new VM tracing file, defaults to #n

Type file:

string, FD handle or #n, optional

Param mode:

file mode, defaults to "w"

Type mode:

string, optional

Return:

#<unspec>

function %%idio-dasm [c]

generate the disassembler code for closure c or everything

Param c:

(optional) the closure to disassemble

Type c:

closure

The output goes to the file(s) idio-vm-dasm.n in the current directory. These may get overwritten when Idio stops.

function %vm-call-tree [args]

Show the current call tree.

Param args:

(optional)

Type args:

list

function %vm-decode-stack

Decode the current stack.

function %vm-tables

Dump the VM’s tables.

function %vm-frame-tree [args]

Show the current frame tree.

Param args:

(optional)

Type args:

list

function %vm-trap-state

Show the current trap tree.

Last built at 2024-12-21T07:10:39Z+0000 from 62cca4c (dev) for Idio 0.3.b.6