MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / prelocked_thread_interrupt

Function prelocked_thread_interrupt

thread/thread.cpp:1445–1461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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))

Callers 4

thread_interruptFunction · 0.85
resume_oneMethod · 0.85
do_mutex_unlockFunction · 0.85
try_resumeMethod · 0.85

Calls 7

AtomicRunQClass · 0.85
get_vcpuMethod · 0.80
dequeue_ready_atomicMethod · 0.80
unlikelyFunction · 0.50
popMethod · 0.45
insert_tailMethod · 0.45

Tested by

no test coverage detected