Returns True if semaphore cannot be acquired immediately.
(self)
| 357 | return f'<{res[1:-1]} [{extra}]>' |
| 358 | |
| 359 | def locked(self): |
| 360 | """Returns True if semaphore cannot be acquired immediately.""" |
| 361 | return self._value == 0 or ( |
| 362 | any(not w.cancelled() for w in (self._waiters or ()))) |
| 363 | |
| 364 | async def acquire(self): |
| 365 | """Acquire a semaphore. |