from typing import Any, Callable, Deque, TypeVar

_T = TypeVar("_T")

class mutex:
    locked: bool
    queue: Deque[Any]
    def __init__(self) -> None: ...
    def test(self) -> bool: ...
    def testandset(self) -> bool: ...
    def lock(self, function: Callable[[_T], Any], argument: _T) -> None: ...
    def unlock(self) -> None: ...
