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

Function thread_interrupt

thread/thread.cpp:1462–1478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1460 }
1461 }
1462 void thread_interrupt(thread* th, int error_number)
1463 {
1464 if (unlikely(!th))
1465 LOG_ERROR_RETURN(EINVAL, , "invalid parameter");
1466 auto state = th->state;
1467 if (unlikely(state != states::SLEEPING)) {
1468 out: // may have thread_yield()-ed
1469 if (state == states::READY && th->error_number == 0)
1470 th->error_number = error_number;
1471 return;
1472 }
1473 SCOPED_LOCK(th->lock);
1474 state = th->state;
1475 if (unlikely(state != states::SLEEPING)) goto out;
1476
1477 prelocked_thread_interrupt(th, error_number);
1478 }
1479
1480 static void do_stack_pages_gc(void* arg) {
1481#if !defined(_WIN64) && !defined(__aarch64__)

Callers 15

wait_and_fire_eventsMethod · 0.85
io_uring_for_each_cqeMethod · 0.85
wait_and_fire_eventsMethod · 0.85
resetMethod · 0.85
wait_and_fire_eventsMethod · 0.85
resume_libaio_requestersFunction · 0.85
resetMethod · 0.85
libaio_wrapper_finiFunction · 0.85
wait_and_fire_eventsMethod · 0.85
TEST_FFunction · 0.85
terminateMethod · 0.85

Calls 2

unlikelyFunction · 0.50

Tested by 10

TEST_FFunction · 0.68
~TestRPCServerMethod · 0.68
mainFunction · 0.68
task_deferFunction · 0.68
ph_task_deferFunction · 0.68
interruptFunction · 0.68
TESTFunction · 0.68
wait_to_be_interruptFunction · 0.68
sleeperFunction · 0.68
perf_sleepFunction · 0.68