| 1443 | } |
| 1444 | |
| 1445 | static void prelocked_thread_interrupt(thread* th, int error_number) |
| 1446 | { |
| 1447 | vcpu_t* vcpu = th->get_vcpu(); |
| 1448 | assert(th && th->state == states::SLEEPING); |
| 1449 | assert("th->lock is locked"); |
| 1450 | assert(th != CURRENT); |
| 1451 | th->error_number = error_number; |
| 1452 | RunQ rq; |
| 1453 | if (unlikely(!rq.current || vcpu != rq.current->get_vcpu())) { |
| 1454 | th->dequeue_ready_atomic(states::STANDBY); |
| 1455 | vcpu->move_to_standbyq_atomic(th); |
| 1456 | } else { |
| 1457 | th->dequeue_ready_atomic(); |
| 1458 | vcpu->sleepq.pop(th); |
| 1459 | AtomicRunQ(rq).insert_tail(th); |
| 1460 | } |
| 1461 | } |
| 1462 | void thread_interrupt(thread* th, int error_number) |
| 1463 | { |
| 1464 | if (unlikely(!th)) |
no test coverage detected