src/ppe/pk/kernel/pk_thread_core.c
/// Delete a thread
///
/// Any active thread can be deleted.  If a thread is deleted it is removed
/// from the run queue, deleted from the timer queue (if sleeping or blocked
/// on a semaphore with timeout), and deleted from the semaphore mutual
/// exclusion if blocked on a semaphore. The thread control block is then
/// marked as deleted.
///
/// Once a thread has completed or been deleted the thread structure and
/// thread stack areas can be used for other purposes.
///
/// \param thread The thread to delete
///
/// Return values other than PK_OK (0) are errors; see \ref pk_errors.  If a
/// thread deletes itself this API does not return at all.
///
/// \retval 0 Successful completion, including calls on a \a thread that has
/// completed or had already been deleted. 
///
///
/// \retval -PK_INVALID_THREAD_AT_DELETE The \a thread is a null (0) pointer.
Delete a thread
Any active thread can be deleted.  If a thread is deleted it is removed
from the run queue, deleted from the timer queue (if sleeping or blocked
on a semaphore with timeout), and deleted from the semaphore mutual
exclusion if blocked on a semaphore. The thread control block is then
marked as deleted.

Once a thread has completed or been deleted the thread structure and
thread stack areas can be used for other purposes.

\param thread The thread to delete

Return values other than PK_OK (0) are errors; see \ref pk_errors.  If a
thread deletes itself this API does not return at all.

\retval 0 Successful completion, including calls on a \a thread that has
completed or had already been deleted.

\retval -PK_INVALID_THREAD_AT_DELETE The \a thread is a null (0) pointer.
Delete a thread Any active thread can be deleted . If a thread is deleted it is removed from the run queue deleted from the timer queue ( if sleeping or blocked on a semaphore with timeout ) and deleted from the semaphore mutual exclusion if blocked on a semaphore . The thread control block is then marked as deleted . Once a thread has completed or been deleted the thread structure and thread stack areas can be used for other purposes . \ param thread The thread to delete Return values other than PK_OK ( 0 ) are errors ; see \ ref pk_errors . If a thread deletes itself this API does not return at all . \ retval 0 Successful completion including calls on a \ a thread that has completed or had already been deleted . \ retval - PK_INVALID_THREAD_AT_DELETE The \ a thread is a null ( 0 ) pointer .
int
pk_thread_delete(PkThread *thread)
{
    if (PK_ERROR_CHECK_API) {
        PK_ERROR_IF(thread == 0, PK_INVALID_THREAD_AT_DELETE);
    }
    __pk_thread_delete(thread, PK_THREAD_STATE_DELETED);
    return PK_OK;
}
int pk_thread_delete ( PkThread * thread ) { if ( PK_ERROR_CHECK_API ) { PK_ERROR_IF ( thread == 0 , PK_INVALID_THREAD_AT_DELETE ) ; } __pk_thread_delete ( thread , PK_THREAD_STATE_DELETED ) ; return PK_OK ; }
Delete a thread
Any active thread can be deleted.
Delete a thread Any active thread can be deleted .