# Threading

Module: `pyot.utils.threading`

### *class* `AsyncLock`

> An asynchronous threading Lock. The event loop won't be blocked when acquiring the lock.

Definitions:

* `__aenter__` -> `bool`
  * `args`: `None`
* `__aexit__` -> `None`
  * `args`: `None`
* `__init__` -> `None`

Methods:

* *asyncmethod* `acquire` -> `bool`

  > Acquire the lock without locking the loop
* *method* `release` -> `None`

  > Release the lock, this is not async because it is immediate and useful for hooks (e.g. registering `atexit`)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pyot.iann838.com/utils/threading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
