- task_lock(task);
- active_acts = --task->active_act_count;
- task_unlock(task);
- if (!active_acts && task->bsd_info)
- proc_exit(task->bsd_info);
-
-#ifdef CALLOUT_RPC_MODEL
- if (thr_act->lower) {
- /*
- * JMM - RPC will not be using a callout/stack manipulation
- * mechanism. instead we will let it return normally as if
- * from a continuation. Accordingly, these need to be cleaned
- * up a bit.
- */
- act_switch_swapcheck(thread, (ipc_port_t)0);
- act_lock(thr_act); /* hierarchy violation XXX */
- (void) switch_act(THR_ACT_NULL);
- assert(thr_act->ref_count == 1); /* XXX */
- /* act_deallocate(thr_act); XXX */
- prev_act = thread->top_act;
- /*
- * disable preemption to protect kernel stack changes
- * disable_preemption();
- * MACH_RPC_RET(prev_act) = KERN_RPC_SERVER_TERMINATED;
- * machine_kernel_stack_init(thread, mach_rpc_return_error);
- */
- act_unlock(thr_act);