massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / multiprocessing / synchronize.pyi
1 import sys
2 import threading
3 from contextlib import AbstractContextManager
4 from multiprocessing.context import BaseContext
5 from typing import Any, Callable, Union
6
7 _LockLike = Union[Lock, RLock]
8
9 class Barrier(threading.Barrier):
10     def __init__(
11         self, parties: int, action: Callable[..., Any] | None = ..., timeout: float | None = ..., *ctx: BaseContext
12     ) -> None: ...
13
14 class BoundedSemaphore(Semaphore):
15     def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ...
16
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: ...
21     else:
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: ...
28
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: ...
35
36 class Lock(SemLock):
37     def __init__(self, *, ctx: BaseContext) -> None: ...
38
39 class RLock(SemLock):
40     def __init__(self, *, ctx: BaseContext) -> None: ...
41
42 class Semaphore(SemLock):
43     def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ...
44
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: ...