Move cap_enter() to the beginning of run_queue()