Skip to content

Commit

Permalink
Magic way to avoid JIT being disabled (#4029)
Browse files Browse the repository at this point in the history
  • Loading branch information
twose authored Jan 27, 2021
1 parent 709813f commit b63dbe1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext-src/php_swoole.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ PHP_RINIT_FUNCTION(swoole) {
SIGG(check) = 0;
#endif

php_swoole_coroutine_rinit();
php_swoole_runtime_rinit();

SWOOLE_G(req_status) = PHP_SWOOLE_RINIT_END;
Expand Down
1 change: 1 addition & 0 deletions ext-src/php_swoole.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ void php_swoole_redis_server_minit(int module_number);
* RINIT
* ==============================================================
*/
void php_swoole_coroutine_rinit();
void php_swoole_runtime_rinit();

/**
Expand Down
2 changes: 2 additions & 0 deletions ext-src/swoole_coroutine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,9 @@ void php_swoole_coroutine_minit(int module_number) {

SW_REGISTER_LONG_CONSTANT("SWOOLE_EXIT_IN_COROUTINE", SW_EXIT_IN_COROUTINE);
SW_REGISTER_LONG_CONSTANT("SWOOLE_EXIT_IN_SERVER", SW_EXIT_IN_SERVER);
}

void php_swoole_coroutine_rinit() {
if (SWOOLE_G(cli)) {
ori_exit_handler = zend_get_user_opcode_handler(ZEND_EXIT);
zend_set_user_opcode_handler(ZEND_EXIT, coro_exit_handler);
Expand Down

0 comments on commit b63dbe1

Please sign in to comment.