next up previous contents
Next: 2.7 fluke_thread_disable_exceptions: prevent exceptions Up: 2 Thread Previous: 2.5 fluke_thread_create_hash: create a

2.6 fluke_thread_destroy: destroy a thread

SYNOPSIS

void fluke_thread_destroy(fluke_thread_t *thread);

DESCRIPTION

Destroys a thread created with fluke_thread_create. The caller must ensure that the target thread is not currently running; otherwise the results are undefined. This means by implication that a thread cannot call fluke_thread_destroy on itself.

Any references to the destroyed thread object become invalid. Any other thread performing an idempotent IPC to this thread will be woken up and will receive an error return.

If the thread being destroyed is involved in reliable IPC, an alert is sent to the other threads involved and the IPC connections are broken. The other threads involved will receive errors if they attempt further IPC with this thread. If any other threads are waiting on this thread, they are woken up immediately.

PARAMETERS

thread
The thread to destroy. The thread must not be running.

ERRORS

If any of the following errors is detected by the Fluke implementation, it causes the current thread to take a synchronous exception with one of the following codes. All of these have an implicit FLUKE_INSANITY_ prefix.
NO_OBJECT
thread does not point to an active object.
NOT_THREAD
The object pointed to by thread is not a thread object.
INVALID_OBJECT
The state of the thread object has become invalid.
CURRENT_THREAD
A thread attempted to destroy itself.

RELATED INFORMATION

fluke_thread_create



Utah Flux Research Group