summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util/concurrency.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-09-14 08:04:09 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-09-14 08:04:09 -0400
commit4d17fe4063adef50c1d529993e0b047f503940e2 (patch)
tree20b53461c593e71297fa034ccdaaea629c461728 /lib/sqlalchemy/util/concurrency.py
parent056c929e15c735059b2f17f9ae5391d3ad244907 (diff)
downloadsqlalchemy-4d17fe4063adef50c1d529993e0b047f503940e2.tar.gz
Adapt event exec_once_mutex to asyncio
The pool makes use of a threading.Lock() for the "first_connect" event. if the pool is async make sure this is a greenlet-adapted asyncio lock. Fixes: #5581 Change-Id: If52415839c7ed82135465f1fe93b95d86c305820
Diffstat (limited to 'lib/sqlalchemy/util/concurrency.py')
-rw-r--r--lib/sqlalchemy/util/concurrency.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/concurrency.py b/lib/sqlalchemy/util/concurrency.py
index 4c4ea20d1..e0883aa68 100644
--- a/lib/sqlalchemy/util/concurrency.py
+++ b/lib/sqlalchemy/util/concurrency.py
@@ -7,6 +7,7 @@ if compat.py3k:
from ._concurrency_py3k import await_fallback
from ._concurrency_py3k import greenlet
from ._concurrency_py3k import greenlet_spawn
+ from ._concurrency_py3k import AsyncAdaptedLock
else:
asyncio = None
greenlet = None
@@ -19,3 +20,6 @@ else:
def greenlet_spawn(fn, *args, **kw):
raise ValueError("Cannot use this function in py2.")
+
+ def AsyncAdaptedLock(*args, **kw):
+ raise ValueError("Cannot use this function in py2.")