// Called in thread death callback. static void uu_proc_thread_kill( phantom_thread_t *t ) { assert(t); //uuprocess_t *p = t->u; tid_t tid = t->tid; pid_t pid; if( t_get_pid( tid, &pid ) ) { SHOW_ERROR( 1, "Thread %d must have pid but doesnt", tid ); return; } //assert(p); SHOW_FLOW( 1, "Thread %d of process %d dies", tid, pid ); uu_proc_rm_thread( pid, tid ); }
// TODO no interlock - process can be klled when we use it - use pool for processes! void syscall_sw(struct trap_state *st) { //phantom_thread_t *t = GET_CURRENT_THREAD(); //uuprocess_t *u = t->u; tid_t tid = get_current_tid(); pid_t pid; assert( !t_get_pid( tid, &pid )); uuprocess_t *u = proc_by_pid(pid); /* int ret; if( (ret = setjmp(u->signal_jmpbuf)) ) { execute_signals(u, st); return; } */ do_syscall_sw( u, st ); execute_signals(u, st); }