44Handling the Python Global Interpreter Lock.
55
66See [`lock`](@ref), [`@lock`](@ref), [`unlock`](@ref) and [`@unlock`](@ref).
7+
8+ !!! warning
9+
10+ Multi-threading support is experimental and can change without notice.
711"""
812module GIL
913
@@ -32,6 +36,10 @@ threads. Since the main Julia thread holds the GIL by default, you will need to
3236[`unlock`](@ref) the GIL before using this function.
3337
3438See [`@lock`](@ref) for the macro form.
39+
40+ !!! warning
41+
42+ This function is experimental. Its semantics may be changed without notice.
3543"""
3644function lock (f)
3745 state = C. PyGILState_Ensure ()
@@ -52,6 +60,10 @@ threads. Since the main Julia thread holds the GIL by default, you will need to
5260[`@unlock`](@ref) the GIL before using this function.
5361
5462The macro equivalent of [`lock`](@ref).
63+
64+ !!! warning
65+
66+ This macro is experimental. Its semantics may be changed without notice.
5567"""
5668macro lock (expr)
5769 quote
@@ -74,6 +86,10 @@ Python code. That other thread can be a Julia thread, which must lock the GIL us
7486[`lock`](@ref).
7587
7688See [`@unlock`](@ref) for the macro form.
89+
90+ !!! warning
91+
92+ This function is experimental. Its semantics may be changed without notice.
7793"""
7894function unlock (f)
7995 state = C. PyEval_SaveThread ()
@@ -94,6 +110,10 @@ Python code. That other thread can be a Julia thread, which must lock the GIL us
94110[`@lock`](@ref).
95111
96112The macro equivalent of [`unlock`](@ref).
113+
114+ !!! warning
115+
116+ This macro is experimental. Its semantics may be changed without notice.
97117"""
98118macro unlock (expr)
99119 quote
0 commit comments