… | |
… | |
848 | else |
848 | else |
849 | coro->flags |= CF_READY; /* make sure it is NOT put into the readyqueue */ |
849 | coro->flags |= CF_READY; /* make sure it is NOT put into the readyqueue */ |
850 | |
850 | |
851 | if (coro->mainstack && coro->mainstack != main_mainstack) |
851 | if (coro->mainstack && coro->mainstack != main_mainstack) |
852 | { |
852 | { |
|
|
853 | struct coro temp; |
|
|
854 | |
853 | assert (!(coro->flags & CF_RUNNING)); |
855 | assert (!(coro->flags & CF_RUNNING)); |
854 | |
856 | |
855 | struct coro temp; |
|
|
856 | Zero (&temp, 1, struct coro); |
857 | Zero (&temp, 1, struct coro); |
857 | temp.save = CORO_SAVE_ALL; |
858 | temp.save = CORO_SAVE_ALL; |
858 | |
859 | |
859 | if (coro->flags & CF_RUNNING) |
860 | if (coro->flags & CF_RUNNING) |
860 | croak ("FATAL: tried to destroy currently running coroutine"); |
861 | croak ("FATAL: tried to destroy currently running coroutine"); |
… | |
… | |
1025 | next_sv = coro_deq (PRIO_MIN); |
1026 | next_sv = coro_deq (PRIO_MIN); |
1026 | |
1027 | |
1027 | /* nothing to schedule: call the idle handler */ |
1028 | /* nothing to schedule: call the idle handler */ |
1028 | if (!next_sv) |
1029 | if (!next_sv) |
1029 | { |
1030 | { |
|
|
1031 | dSP; |
1030 | UNLOCK; |
1032 | UNLOCK; |
1031 | dSP; |
|
|
1032 | |
1033 | |
1033 | ENTER; |
1034 | ENTER; |
1034 | SAVETMPS; |
1035 | SAVETMPS; |
1035 | |
1036 | |
1036 | PUSHMARK (SP); |
1037 | PUSHMARK (SP); |