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

Function prepare_switch

thread/thread.cpp:740–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738 static void spinlock_unlock(void* m_);
739
740 inline void prepare_switch(thread* from, thread* to) {
741 assert(from->vcpu == to->vcpu);
742 assert(to->state == states::RUNNING);
743 auto& cnt = to->get_vcpu()->switch_count;
744 (*(uint64_t*)&cnt)++; // increment of volatile variable is deprecated
745 }
746
747#pragma GCC diagnostic push
748#pragma GCC diagnostic ignored "-Winvalid-offsetof"

Callers 2

switch_contextFunction · 0.85
switch_context_deferFunction · 0.85

Calls 1

get_vcpuMethod · 0.80

Tested by

no test coverage detected