pthread_mutex_lock(&ct_mutex); pthread_cond_signal(&lwp_cpptr->c); pthread_mutex_unlock(&ct_mutex); pthread_exit(t);
LWP_INT_LOCK(&ct_mutex); LWP_INT_SIGNAL(&lwp_cpptr->c); LWP_INT_UNLOCK(&ct_mutex); LWP_INT_EXIT(t);
LWP_DestroyProcess(PROCESS pid){  void *t;  Debug(0, ("Entered Destroy_Process"));  if (lwp_init) {    pthread_attr_destroy(&pid->a);    if (lwp_cpptr == pid){      /* kill myself */      pid->status = DESTROYED;      Free_PCB(pid);      Cal_Highest_runnable_priority();            /* Calculate next runnable lwp and signal it */      lwp_cpptr = runnable[Highest_runnable_priority].head;      lwpremove(lwp_cpptr, &runnable[Highest_runnable_priority]);            pthread_mutex_lock(&ct_mutex);      pthread_cond_signal(&lwp_cpptr->c);      pthread_mutex_unlock(&ct_mutex);      pthread_exit(t);    } else {      /* kill some other process - mark status destroyed - 	 if process is blocked, it will be purged on next create proc;	 if it is runnable the dispatcher will kill it */      pid->status = DESTROYED ;      Dispatcher();    }    return LWP_SUCCESS ;  } else    return LWP_EINIT;}