Skip to content

Commit 213f6ba

Browse files
committed
热更新时关闭协程死锁检查
1 parent 6859577 commit 213f6ba

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/concerns/InteractsWithServer.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace think\swoole\concerns;
44

55
use Swoole\Constant;
6+
use Swoole\Coroutine;
67
use Swoole\Process;
78
use Swoole\Process\Pool;
89
use Swoole\Runtime;
@@ -54,6 +55,9 @@ public function start(string $envName): void
5455
{
5556
$this->setProcessName('manager process');
5657

58+
//协程配置
59+
Coroutine::set($this->getConfig('coroutine', []));
60+
5761
$this->initialize();
5862
$this->triggerEvent('init');
5963

@@ -134,8 +138,12 @@ public function runWithBarrier(callable $func, ...$params)
134138
*/
135139
protected function addHotUpdateProcess()
136140
{
137-
$this->addWorker(function (Process\Pool $pool) {
141+
//热更新时关闭协程死锁检查
142+
Coroutine::set([
143+
'enable_deadlock_check' => false,
144+
]);
138145

146+
$this->addWorker(function (Process\Pool $pool) {
139147
$watcher = $this->container->make(Watcher::class);
140148

141149
$watcher->watch(function () use ($pool) {

0 commit comments

Comments
 (0)