public function acquire() : \Generator
{
$tsl = function () {
return $this->lock ? $this->lock = false : true;
};
while (!$this->lock || $this->synchronized($tsl)) {
yield from Coroutine\sleep(self::LATENCY_TIMEOUT);
}
return new Lock(function () {
$this->release();
});
}