NAME ^

src/pmc/parrotrunningthread.pmc -- Represents a running Parrot Thread.

DESCRIPTION ^

This type represents a running parrot thread.

It provides the following methods: - join - detach - kill

Note that a running thread object becomes invalid when a thread finishes while detached or joined. Further operations on the object may have unexpected behavior, such as manipulating an unrelated thread.

Methods ^

void init()

Create a new, invalid handle to a running thread.

void init_pmc(PMC *tid)

Create a new running thread referring to the thread with the Thread ID specified in tid.

INTVAL get_integer()

Return the thread ID of this thread.

void set_integer_native(INTVAL new_tid)

Change the thread ID we refer to to new_tid.

*/

    VTABLE void set_integer_native(INTVAL new_tid) {
        PMC_int_val(SELF) = new_tid;
    }
/*
METHOD join()

Join the thread, returning whatever its main method returns.

METHOD detach()

Detach the thread so it cannot be joined and will free its resources immediatelly when it exits.

METHOD kill()

Terminate a running thread.


parrot