--- /dev/null
+from typing import Callable, ContextManager, Optional, Union\r
+\r
+from multiprocessing.context import BaseContext\r
+import threading\r
+import sys\r
+\r
+_LockLike = Union[Lock, RLock]\r
+\r
+class Barrier(threading.Barrier):\r
+ def __init__(self,\r
+ parties: int,\r
+ action: Optional[Callable] = ...,\r
+ timeout: Optional[float] = ...,\r
+ *\r
+ ctx: BaseContext) -> None: ...\r
+\r
+class BoundedSemaphore(Semaphore):\r
+ def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ...\r
+\r
+class Condition(ContextManager[bool]):\r
+ def __init__(self,\r
+ lock: Optional[_LockLike] = ...,\r
+ *,\r
+ ctx: BaseContext) -> None: ...\r
+ if sys.version_info >= (3, 7):\r
+ def notify(self, n: int = ...) -> None: ...\r
+ else:\r
+ def notify(self) -> None: ...\r
+ def notify_all(self) -> None: ...\r
+ def wait(self, timeout: Optional[float] = ...) -> bool: ...\r
+ def wait_for(self,\r
+ predicate: Callable[[], bool],\r
+ timeout: Optional[float] = ...) -> bool: ...\r
+ def acquire(self,\r
+ block: bool = ...,\r
+ timeout: Optional[float] = ...) -> bool: ...\r
+ def release(self) -> None: ...\r
+\r
+class Event(ContextManager[bool]):\r
+ def __init__(self,\r
+ lock: Optional[_LockLike] = ...,\r
+ *,\r
+ ctx: BaseContext) -> None: ...\r
+ def is_set(self) -> bool: ...\r
+ def set(self) -> None: ...\r
+ def clear(self) -> None: ...\r
+ def wait(self, timeout: Optional[float] = ...) -> bool: ...\r
+\r
+class Lock(SemLock):\r
+ def __init__(self, *, ctx: BaseContext) -> None: ...\r
+\r
+class RLock(SemLock):\r
+ def __init__(self, *, ctx: BaseContext) -> None: ...\r
+\r
+class Semaphore(SemLock):\r
+ def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ...\r
+\r
+# Not part of public API\r
+class SemLock(ContextManager[bool]):\r
+ def acquire(self,\r
+ block: bool = ...,\r
+ timeout: Optional[float] = ...) -> bool: ...\r
+ def release(self) -> None: ...\r