mirror of
https://github.com/python/cpython.git
synced 2025-12-05 09:03:50 +00:00
#1625509: describe behaviour of import lock
This commit is contained in:
parent
311c580539
commit
4ff7fc49c6
1 changed files with 7 additions and 1 deletions
|
|
@ -114,10 +114,16 @@ This module provides an interface to the mechanisms used to implement the
|
||||||
|
|
||||||
.. function:: acquire_lock()
|
.. function:: acquire_lock()
|
||||||
|
|
||||||
Acquires the interpreter's import lock for the current thread. This lock should
|
Acquire the interpreter's import lock for the current thread. This lock should
|
||||||
be used by import hooks to ensure thread-safety when importing modules. On
|
be used by import hooks to ensure thread-safety when importing modules. On
|
||||||
platforms without threads, this function does nothing.
|
platforms without threads, this function does nothing.
|
||||||
|
|
||||||
|
Once a thread has acquired the import lock, the same thread may acquire it
|
||||||
|
again without blocking; the thread must release it once for each time it has
|
||||||
|
acquired it.
|
||||||
|
|
||||||
|
On platforms without threads, this function does nothing.
|
||||||
|
|
||||||
.. versionadded:: 2.3
|
.. versionadded:: 2.3
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue