lisp/c/mthread_posix.c
int 
//thd_continue (pthread_t target_thread)
pthread_continue (pthread_t target_thread)
{
    int status;
    int i = 0;
    /* 
     * Serialize access to suspend, makes life easier
     */
    status = pthread_mutex_lock (&susp_mut);
    if (status != 0)
        return status;

    /*
     * If we haven't been initialized, then the thread must be "resumed"
     * it couldn't have been suspended!
     */
    if (!susp_inited) {
        status = pthread_mutex_unlock (&susp_mut);
        return status;
    }

    /*
     * Make sure the thread is in the suspend array. If not, it
     * hasn't been suspended (or it has already been resumed) and
     * we can just carry on.
     */
    while (susp_array[i] != target_thread && i < susp_bottom) 
        i++;

    if (i >= susp_bottom) {
        pthread_mutex_unlock (&susp_mut);
        return 0;
    }

    /*
     * Signal the thread to continue, and remove the thread from
     * the suspended array.
     */
    status = pthread_kill (target_thread, SIGUSR2);
    if (status != 0) {
        pthread_mutex_unlock (&susp_mut);
        return status;
    }

    susp_array[i] = 0;               /* Clear array element */
    status = pthread_mutex_unlock (&susp_mut);
    return status;
}
/*
 * Resume a suspended thread by sending it SIGUSR2 to break
 * it out of the sigsuspend() in which it's waiting. If the
 * target thread isn't suspended, return with success.
 */
Resume a suspended thread by sending it SIGUSR2 to break
it out of the sigsuspend() in which it's waiting. If the
target thread isn't suspended, return with success.
Resume a suspended thread by sending it SIGUSR2 to break it out of the sigsuspend () in which it ' s waiting . If the target thread isn ' t suspended return with success .
int 
pthread_continue (pthread_t target_thread)
{
    int status;
    int i = 0;
    status = pthread_mutex_lock (&susp_mut);
    if (status != 0)
        return status;
    if (!susp_inited) {
        status = pthread_mutex_unlock (&susp_mut);
        return status;
    }
    while (susp_array[i] != target_thread && i < susp_bottom) 
        i++;
    if (i >= susp_bottom) {
        pthread_mutex_unlock (&susp_mut);
        return 0;
    }
    status = pthread_kill (target_thread, SIGUSR2);
    if (status != 0) {
        pthread_mutex_unlock (&susp_mut);
        return status;
    }
    susp_array[i] = 0;               
    status = pthread_mutex_unlock (&susp_mut);
    return status;
}
int pthread_continue ( pthread_t target_thread ) { int status ; int i = 0 ; status = pthread_mutex_lock ( & susp_mut ) ; if ( status != 0 ) return status ; if ( ! susp_inited ) { status = pthread_mutex_unlock ( & susp_mut ) ; return status ; } while ( susp_array [ i ] != target_thread && i < susp_bottom ) i ++ ; if ( i >= susp_bottom ) { pthread_mutex_unlock ( & susp_mut ) ; return 0 ; } status = pthread_kill ( target_thread , SIGUSR2 ) ; if ( status != 0 ) { pthread_mutex_unlock ( & susp_mut ) ; return status ; } susp_array [ i ] = 0 ; status = pthread_mutex_unlock ( & susp_mut ) ; return status ; }
Resume a suspended thread by sending it SIGUSR2 to break
 it out of the sigsuspend() in which it's waiting.
Resume a suspended thread by sending it SIGUSR2 to break it out of the sigsuspend () in which it ' s waiting .
//thd_continue (pthread_t target_thread) /* 
     * Serialize access to suspend, makes life easier
     */ /*
     * If we haven't been initialized, then the thread must be "resumed"
     * it couldn't have been suspended!
     */ /*
     * Make sure the thread is in the suspend array. If not, it
     * hasn't been suspended (or it has already been resumed) and
     * we can just carry on.
     */ /*
     * Signal the thread to continue, and remove the thread from
     * the suspended array.
     */ /* Clear array element */