| 702 | th->remove_from_list(); |
| 703 | } |
| 704 | bool defer_to_new_thread() const { |
| 705 | auto idle_worker = vcpu->idle_worker; |
| 706 | if (current->next() == idle_worker) { |
| 707 | if (idle_worker->next() == current) { |
| 708 | // if defer_func is executed in idle_worker and it yields, |
| 709 | // photon will be broken. so we should return true and |
| 710 | // create a new thread to execute the defer func. |
| 711 | return true; |
| 712 | } |
| 713 | |
| 714 | // postpone idle worker |
| 715 | auto next = idle_worker->remove_from_list(); |
| 716 | next->insert_after(idle_worker); |
| 717 | } |
| 718 | return false; |
| 719 | } |
| 720 | }; |
| 721 | |
| 722 | inline void thread::dequeue_ready_atomic(states newstat) |
no test coverage detected