Functions | |
word_t | croc_thread_new (CrocThread *t, word_t func) |
CrocThreadState | croc_thread_getState (CrocThread *t) |
const char * | croc_thread_getStateString (CrocThread *t) |
uword_t | croc_thread_getCallDepth (CrocThread *t) |
void | croc_thread_reset (CrocThread *t, word_t slot) |
void | croc_thread_resetWithFunc (CrocThread *t, word_t slot) |
void | croc_thread_halt (CrocThread *t) |
void | croc_thread_pendingHalt (CrocThread *t) |
int | croc_thread_hasPendingHalt (CrocThread *t) |
Functions which operate on threads.
word_t croc_thread_new | ( | CrocThread * | t, |
word_t | func | ||
) |
Creates and pushes a new thread object in this VM, using the script function at func
as its main function.
The new thread will be in the initial state and can be started by calling it like a function.
CrocThreadState croc_thread_getState | ( | CrocThread * | t | ) |
const char* croc_thread_getStateString | ( | CrocThread * | t | ) |
uword_t croc_thread_getCallDepth | ( | CrocThread * | t | ) |
void croc_thread_reset | ( | CrocThread * | t, |
word_t | slot | ||
) |
Resets a dead thread at slot
to the initial state, keeping the same main function.
void croc_thread_resetWithFunc | ( | CrocThread * | t, |
word_t | slot | ||
) |
Resets a dead thread at slot
to the initial state, but changes its main function to the script function that is on top of the stack.
The function is popped.
void croc_thread_halt | ( | CrocThread * | t | ) |
Halts the given thread.
If the thread is currently running, immediately throws a HaltException
on it. Otherwise, it places a pending halt on the thread (see croc_thread_pendingHalt).
void croc_thread_pendingHalt | ( | CrocThread * | t | ) |
Places a pending halt on the thread.
The thread will not halt immediately, but as soon as it begins executing script code, it will.
int croc_thread_hasPendingHalt | ( | CrocThread * | t | ) |