public function then(callable $code) { if (!call_user_func($this->check)) { return; } $this->mutex->synchronized(function () use($code) { if (call_user_func($this->check)) { call_user_func($code); } }); }