3 from contextlib import AbstractContextManager
4 from multiprocessing.context import BaseContext
5 from typing import Any, Callable, Union
7 _LockLike = Union[Lock, RLock]
9 class Barrier(threading.Barrier):
11 self, parties: int, action: Callable[..., Any] | None = ..., timeout: float | None = ..., *ctx: BaseContext
14 class BoundedSemaphore(Semaphore):
15 def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ...
17 class Condition(AbstractContextManager[bool]):
18 def __init__(self, lock: _LockLike | None = ..., *, ctx: BaseContext) -> None: ...
19 if sys.version_info >= (3, 7):
20 def notify(self, n: int = ...) -> None: ...
22 def notify(self) -> None: ...
23 def notify_all(self) -> None: ...
24 def wait(self, timeout: float | None = ...) -> bool: ...
25 def wait_for(self, predicate: Callable[[], bool], timeout: float | None = ...) -> bool: ...
26 def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
27 def release(self) -> None: ...
29 class Event(AbstractContextManager[bool]):
30 def __init__(self, lock: _LockLike | None = ..., *, ctx: BaseContext) -> None: ...
31 def is_set(self) -> bool: ...
32 def set(self) -> None: ...
33 def clear(self) -> None: ...
34 def wait(self, timeout: float | None = ...) -> bool: ...
37 def __init__(self, *, ctx: BaseContext) -> None: ...
40 def __init__(self, *, ctx: BaseContext) -> None: ...
42 class Semaphore(SemLock):
43 def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ...
45 # Not part of public API
46 class SemLock(AbstractContextManager[bool]):
47 def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
48 def release(self) -> None: ...