Skip to content

Commit 14c58a0

Browse files
committed
Update disable mutil-thread
1 parent 5f269de commit 14c58a0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

swoole.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ PHP_FUNCTION(swoole_server_create)
416416
return;
417417
}
418418

419-
if(serv_mode == SW_MODE_THREAD)
419+
if (serv_mode == SW_MODE_THREAD || serv_mode == SW_MODE_BASE)
420420
{
421-
serv_mode = SW_MODE_SINGLE;
422-
zend_error(E_WARNING, "PHP can not running at multi-threading. Reset mode to SW_MODE_BASE");
421+
serv_mode = SW_MODE_PROCESS;
422+
zend_error(E_WARNING, "PHP can not running at multi-threading. Reset mode to SWOOLE_PROCESS");
423423
}
424424

425425
serv->factory_mode = serv_mode;
@@ -434,9 +434,9 @@ PHP_FUNCTION(swoole_server_create)
434434

435435
bzero(php_sw_callback, sizeof(zval*) * PHP_SERVER_CALLBACK_NUM);
436436

437-
if(swServer_addListen(serv, sock_type, serv_host, serv_port) < 0)
437+
if (swServer_addListen(serv, sock_type, serv_host, serv_port) < 0)
438438
{
439-
zend_error(E_ERROR, "swServer_addListen fail. Error: %s [%d]", strerror(errno), errno);
439+
zend_error(E_ERROR, "swServer_addListen failed. Error: %s [%d]", strerror(errno), errno);
440440
}
441441
if (!getThis())
442442
{
@@ -1265,7 +1265,7 @@ int php_swoole_onReceive(swFactory *factory, swEventData *req)
12651265

12661266
MAKE_STD_ZVAL(zfrom_id);
12671267

1268-
if(req->info.type == SW_EVENT_UDP)
1268+
if (req->info.type == SW_EVENT_UDP)
12691269
{
12701270
udp_info.from_fd = req->info.from_fd;
12711271
udp_info.port = req->info.from_id;

0 commit comments

Comments
 (0)