#include <lwp/lwp.h> #include <lwp/lwpmachdep.h>
int lwp_enumerate(vec, maxsize) thread_t vec[]; /* list of id's to be filled in */ int maxsize; /* number of elements in vec */
int lwp_ping(tid) thread_t tid;
int lwp_getregs(tid, machstate) thread_t tid; machstate_t *machstate;
int lwp_setregs(tid, machstate) thread_t tid; machstate_t *machstate;
int lwp_getstate(tid, statvec) thread_t tid; statvec_t *statvec;
int lwp_self(tid) thread_t *tid;
lwp_self() returns the ID of the current thread in tid. This is the only way to retrieve the identity of main.
lwp_enumerate() fills in a list with the ID's of all existing threads and returns the total number of threads. This primitive will use maxsize to avoid exceeding the capacity of the list. If the number of threads is greater than maxsize, only maxsize thread ID's are filled in vec. If maxsize is zero, lwp_enumerate() just returns the total number of threads.
lwp_getstate() is used to retrieve the context of a given thread. It is possible to see what object (thread, monitor, etc.) if any that thread is blocked on, and the scheduling priority of the thread.
lwp_ping returns 0 (no error) if the thread tid exists. Otherwise, -1 is returned.
lwp_setregs sets the machine-dependent context (i.e., registers) of a thread. The next time the thread is scheduled in, this context is installed. Consult lwpmachdep.h for the details. lwp_getregs retrieves the machine-dependent context. Note: the registers may not be meaningful unless the thread in question is blocked or suspended because the state of the registers as of the most recent context switch is returned.
lwp_enumerate() returns the total number of threads.
lwp_ping returns 0 if the specified thread exists, else -1.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97