src/precore/util/concurrent/LockedRunnableWrapper.php
public function run() : void
    {
        $thrownException = null;
        try {
            $this->lock->lock();
            try {
                $this->runnable->run();
            } catch (Exception $e) {
                self::getLogger()->error($e);
                $thrownException = $e;
            }
            $this->lock->unLock();
        } catch (LockException $e) {
            throw new RunException('Lock error during running.', 0, $e);
        }
        if ($thrownException !== null) {
            throw new RunException('Error during execution wrapped Runnable object.', 0, $thrownException);
        }
    }
public function run() : void
    {
        $thrownException = null;
        try {
            $this->lock->lock();
            try {
                $this->runnable->run();
            } catch (Exception $e) {
                self::getLogger()->error($e);
                $thrownException = $e;
            }
            $this->lock->unLock();
        } catch (LockException $e) {
            throw new RunException('Lock error during running.', 0, $e);
        }
        if ($thrownException !== null) {
            throw new RunException('Error during execution wrapped Runnable object.', 0, $thrownException);
        }
    }
It wraps any exceptions coming from inner Runnable object.
After the execution the lock become unlocked!

@throws RunException