Performs thread lock / unlock.
@return bool
@since 0.2
168368
public function podiumLock()
    {
        $this->locked = !$this->locked;
        if ($this->save()) {
            Log::info($this->locked ? 'Thread locked' : 'Thread unlocked', $this->id, __METHOD__);
            return true;
        }
        return false;
    }
205222
public function run(): bool
    {
        $this->startMeasure(__METHOD__);

        if (!Any::isArray($this->objects)) {
            return false;
        }

        foreach ($this->objects as $class) {
            forward_static_call([$class, 'boot']);
        }

        $this->stopMeasure(__METHOD__);
        return true;
    }
629682
public function unlock(): bool
    {
        if (!$this->handle) {
            return false;
        }

        if ($this->locked) {
            flock($this->handle, LOCK_UN);
            $this->locked = false;
        }

        fclose($this->handle);
        $this->handle = null;

        return true;
    }
1052433
public boolean isLocked() {

		// always return false when lock is disabled

		if (disabled.get()) {
			return false;
		}

		// check if locked by current process

		if (locked.get()) {
			return true;
		}

		// check if locked by other process

		if (!lock.exists()) {
			return false;
		}

		long now = System.currentTimeMillis();
		long tsp = read();

		LOG.trace("Lock timestamp {} now {} for {}", tsp, now, webcam);

		if (tsp > now - INTERVAL * 2) {
			return true;
		}

		return false;
	}
262282
public function isOverlapping()
    {
        return $this->lockFile &&
            file_exists($this->lockFile) &&
            call_user_func($this->whenOverlapping, filemtime($this->lockFile)) === false;
    }
572789
def try_lock
      locked = false
      Thread.exclusive do
        clean
        unless(locked?(false))
          do_lock
          locked = true
        else
          locked = owner?(Thread.current)
        end
      end
      locked
    end
694234
public function isLocked()
    {
        $this->_validate();
        if ($_SESSION[$this->secretStorage]['locks'][$this->_namespaceName] == true) {
            return true;
        }
        return false;
    }
87761
public void lock() {
		if (cancel != null)
			return;
		if (error != null)
			return;
		Thread t;
		BlockedThreadHandler blockedHandler;
		do {
			synchronized (this) {
				if (!locked) {
					locked = true;
					return;
				}
				t = Thread.currentThread();
				blockedHandler = Threading.getBlockedThreadHandler(t);
				if (blockedHandler != null) break;
				try { this.wait(0); }
				catch (InterruptedException e) { continue; }
			}
		} while (true);
		blockedHandler.blocked(this, 0);
	}
1360970
public boolean unlock() throws IOException {
		if (lock != null) {
			lock.release();
			lock = null;
			return true;
		}
		return false;
	}
651680
public function isLocked()
    {
        if($this->getModel()->getState()->isUnique())
        {
            $entity = $this->getModel()->fetch();

            if($entity->isLockable() && $entity->isLocked()) {
                return true;
            }
        }

        return false;
    }
456782
public function unlock()
    {
        $this->count--;

        if ($this->count < 0) {
            $this->count = 0;
            return false;
        }

        if (0 === $this->count) {
            $this->entityManager->flush();

            return true;
        }

        return false;
    }
1082185
public function unlock()
    {
        if ($this->fp !== null) {
            flock($this->fp, LOCK_UN);
            fclose($this->fp);
            $this->fp = null;
        }

        return true;
    }
749104
public function isLocked()
    {
        if ($this->getFailuresNum() == \Dotdigitalgroup\Email\Model\FailedAuth::NUMBER_MAX_FAILS_LIMIT &&
            strtotime($this->getLastAttemptDate() . '+5 min') > time()) {
            return true;
        }

        return false;
    }
288844
def unlock(self):
        
        return self._encode_invoke(lock_unlock_codec, thread_id=thread_id(),
                                   reference_id=self.reference_id_generator.get_and_increment())
303363
protected function unlock()
    {
        if (null !== $this->lockKey) {
            $this->client->del($this->lockKey);
            $this->lockKey = null;
        }
    }
1348159
public function isLocked()
    {
        $result = false;
        if(!$this->isNew())
        {
            if(isset($this->locked_on) && isset($this->locked_by))
            {
                $locked  = strtotime($this->locked_on);
                $current = strtotime(gmdate('Y-m-d H:i:s'));

                //Check if the lock has gone stale
                if($current - $locked < $this->_lifetime)
                {
                    $userid = $this->getObject('user')->getId();
                    if($this->locked_by != 0 && $this->locked_by != $userid) {
                        $result= true;
                    }
                }
            }
        }

        return $result;
    }
72007
public function unlock()
    {
        $userid = $this->getObject('user')->getId();

        //Only an saved row can be unlocked by the user who locked it
        if(!$this->isNew() && $this->locked_by != 0 && $this->locked_by == $userid)
        {
            $this->locked_by = 0;
            $this->locked_on = 0;

            $this->save();
        }

        return true;
    }