Skip to content

Commit 819c461

Browse files
committed
+ Support ob_start with coroutines
1 parent ccf2f93 commit 819c461

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

coroutine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ ZEND_STACK_ALIGNED void async_coroutine_execute(zend_fiber_transfer *transfer)
251251

252252
/* Call switch handlers for coroutine entering */
253253
if (UNEXPECTED(&coroutine->coroutine.switch_handlers != NULL)) {
254-
ZEND_COROUTINE_CALL_SWITCH_HANDLERS(&coroutine->coroutine, true, false);
254+
ZEND_COROUTINE_ENTER(&coroutine->coroutine);
255255
}
256256

257257
/* Determine the current error_reporting ini setting. */

scheduler.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,11 @@ void async_scheduler_launch(void)
553553
return;
554554
}
555555

556+
zend_async_call_main_coroutine_start_handlers(&main_coroutine->coroutine);
557+
if (UNEXPECTED(EG(exception))) {
558+
return;
559+
}
560+
556561
// Copy the main coroutine context
557562
main_coroutine->context = *EG(main_fiber_context);
558563
// Set the current fiber context to the main coroutine context

0 commit comments

Comments
 (0)