- /*
- * migration APC hook
- */
- if (reasons & AST_APC) {
- act_execute_returnhandlers();
- }
-
- /*
- * thread_block needs to know if the thread's quantum
- * expired so the thread can be put on the tail of
- * run queue. One of the previous actions might well
- * have woken a high-priority thread, so we also use
- * csw_needed check.
- */
- reasons &= (AST_BLOCK | AST_QUANTUM);
- if (reasons == 0) {
- mp_disable_preemption();
- mypr = current_processor();
- if (csw_needed(self, mypr)) {
- reasons = (mypr->first_quantum ? AST_BLOCK : AST_QUANTUM);
- }
- mp_enable_preemption();
- }
- if ((reasons & (AST_BLOCK | AST_QUANTUM)) &&
- (wait_queue_assert_possible(self))) {
- counter(c_ast_taken_block++);