… | |
… | |
1021 | |
1021 | |
1022 | for (;;) |
1022 | for (;;) |
1023 | { |
1023 | { |
1024 | LOCK; |
1024 | LOCK; |
1025 | next_sv = coro_deq (PRIO_MIN); |
1025 | next_sv = coro_deq (PRIO_MIN); |
1026 | UNLOCK; |
|
|
1027 | |
1026 | |
1028 | /* nothing to schedule: call the idle handler */ |
1027 | /* nothing to schedule: call the idle handler */ |
1029 | if (!next_sv) |
1028 | if (!next_sv) |
1030 | { |
1029 | { |
|
|
1030 | UNLOCK; |
1031 | dSP; |
1031 | dSP; |
1032 | |
1032 | |
1033 | ENTER; |
1033 | ENTER; |
1034 | SAVETMPS; |
1034 | SAVETMPS; |
1035 | |
1035 | |
… | |
… | |
1045 | ta->next = SvSTATE (next_sv); |
1045 | ta->next = SvSTATE (next_sv); |
1046 | |
1046 | |
1047 | /* cannot transfer to destroyed coros, skip and look for next */ |
1047 | /* cannot transfer to destroyed coros, skip and look for next */ |
1048 | if (ta->next->flags & CF_DESTROYED) |
1048 | if (ta->next->flags & CF_DESTROYED) |
1049 | { |
1049 | { |
|
|
1050 | UNLOCK; |
1050 | SvREFCNT_dec (next_sv); |
1051 | SvREFCNT_dec (next_sv); |
1051 | /* coro_nready is already taken care of by destroy */ |
1052 | /* coro_nready is already taken care of by destroy */ |
1052 | continue; |
1053 | continue; |
1053 | } |
1054 | } |
1054 | |
1055 | |
1055 | LOCK; |
|
|
1056 | --coro_nready; |
1056 | --coro_nready; |
1057 | UNLOCK; |
1057 | UNLOCK; |
1058 | break; |
1058 | break; |
1059 | } |
1059 | } |
1060 | |
1060 | |