MCPcopy Create free account
hub / github.com/EasyIME/PIME / acquire

Method acquire

python/python3/tornado/locks.py:530–538  ·  view source on GitHub ↗

Attempt to lock. Returns an awaitable. Returns an awaitable, which raises `tornado.util.TimeoutError` after a timeout.

(
        self, timeout: Optional[Union[float, datetime.timedelta]] = None
    )

Source from the content-addressed store, hash-verified

528 return "<%s _block=%s>" % (self.__class__.__name__, self._block)
529
530 def acquire(
531 self, timeout: Optional[Union[float, datetime.timedelta]] = None
532 ) -> Awaitable[_ReleasingContextManager]:
533 """Attempt to lock. Returns an awaitable.
534
535 Returns an awaitable, which raises `tornado.util.TimeoutError` after a
536 timeout.
537 """
538 return self._block.acquire(timeout)
539
540 def release(self) -> None:
541 """Unlock.

Callers 10

__aenter__Method · 0.95
test_reprMethod · 0.95
test_acquire_releaseMethod · 0.95
test_acquire_fifoMethod · 0.95
test_acquire_timeoutMethod · 0.95
test_multi_releaseMethod · 0.95
fMethod · 0.45
fMethod · 0.45

Calls

no outgoing calls

Tested by 9

test_reprMethod · 0.76
test_acquire_releaseMethod · 0.76
test_acquire_fifoMethod · 0.76
test_acquire_timeoutMethod · 0.76
test_multi_releaseMethod · 0.76
fMethod · 0.36
fMethod · 0.36