void fluke_thread_destroy(fluke_thread_t *thread);
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.
- thread
- The thread to destroy. The thread must not be running.
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.
fluke_thread_create