- switch (behavior) {
- case EXCEPTION_STATE: {
- mach_msg_type_number_t state_cnt;
- thread_state_data_t state;
-
- c_thr_exc_raise_state++;
- state_cnt = state_count[flavor];
- kr = thread_getstatus(a_self, flavor,
- (thread_state_t)state,
- &state_cnt);
- if (kr == KERN_SUCCESS) {
- kr = exception_raise_state(exc_port, exception,
- code, codeCnt,
- &flavor,
- state, state_cnt,
- state, &state_cnt);
- if (kr == MACH_MSG_SUCCESS)
- kr = thread_setstatus(a_self, flavor,
- (thread_state_t)state,
- state_cnt);
- }
-
- if (kr == KERN_SUCCESS || kr == MACH_RCV_PORT_DIED)
- return(KERN_SUCCESS);
-
- return(KERN_FAILURE);
- }
-
- case EXCEPTION_DEFAULT:
- c_thr_exc_raise++;
- kr = exception_raise(exc_port,
- retrieve_act_self_fast(a_self),
- retrieve_task_self_fast(a_self->task),
- exception,
- code, codeCnt);