Skip to content

Commit d77eb74

Browse files
committed
Fix thread tests, optimize swoole_implicit_fn --filter=[thread][compile]
1 parent bcf6203 commit d77eb74

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ext-src/php_swoole.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,5 +1525,7 @@ static PHP_FUNCTION(swoole_implicit_fn) {
15251525
#endif
15261526
} else if (SW_STRCASEEQ(fn, l_fn, "abort")) {
15271527
abort();
1528+
} else {
1529+
zend_throw_exception_ex(swoole_exception_ce, SW_ERROR_INVALID_PARAMS, "unknown fn '%s'", fn);
15281530
}
15291531
}

tests/swoole_thread/server/exit.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $serv->on('WorkerStop', function (Server $serv, $workerId) {
4646
});
4747
$serv->on('Request', function ($req, $resp) use ($serv) {
4848
if ($req->server['request_uri'] == '/exit') {
49-
swoole_implicit_fn('exit', CODE);
49+
swoole_implicit_fn('bailout', CODE);
5050
}
5151
});
5252
$serv->on('shutdown', function () {

0 commit comments

Comments
 (0)