From 40d16c372a6b2aa1201c642d99db47502c0fbcda Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 26 Jun 2024 22:39:03 +0200 Subject: [PATCH] Add mutex --- src/Client.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Client.php b/src/Client.php index a0363bd..06b9fbf 100644 --- a/src/Client.php +++ b/src/Client.php @@ -52,6 +52,7 @@ class Client public function addSession(string $session, array $settings = []): API { + $this->mutex ??= new LocalKeyedMutex; $lock = $this->mutex->acquire($session); if (isset($this->instances[$session])) { throw new InvalidArgumentException('Session already exists');