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

Function do_thread_migrate

thread/thread.cpp:2091–2101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2089 return do_thread_migrate(th, v);
2090 }
2091 static int do_thread_migrate(thread* th, vcpu_base* vb) {
2092 assert(vb != th->vcpu);
2093 AtomicRunQ().remove_from_list(th);
2094 th->get_vcpu()->nthreads--;
2095 th->state = STANDBY;
2096 auto vcpu = (vcpu_t*)vb;
2097 th->vcpu = vcpu;
2098 vcpu->nthreads++;
2099 vcpu->move_to_standbyq_atomic(th);
2100 return 0;
2101 }
2102
2103 static std::atomic<uint32_t> _n_vcpu{0};
2104 uint32_t get_vcpu_num() {

Callers 2

do_defer_migrateFunction · 0.85
thread_migrateFunction · 0.85

Calls 4

AtomicRunQClass · 0.85
get_vcpuMethod · 0.80
remove_from_listMethod · 0.45

Tested by

no test coverage detected