File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -912,7 +912,9 @@ promote_and_get_info_and_ufuncimpl_with_locking(
912
912
npy_bool legacy_promotion_is_possible)
913
913
{
914
914
std::shared_mutex *mutex = ((std::shared_mutex *)((PyArrayIdentityHash *)ufunc->_dispatch_cache )->mutex );
915
+ NPY_BEGIN_ALLOW_THREADS
915
916
mutex->lock_shared ();
917
+ NPY_END_ALLOW_THREADS
916
918
PyObject *info = PyArrayIdentityHash_GetItem (
917
919
(PyArrayIdentityHash *)ufunc->_dispatch_cache ,
918
920
(PyObject **)op_dtypes);
@@ -926,7 +928,9 @@ promote_and_get_info_and_ufuncimpl_with_locking(
926
928
927
929
// cache miss, need to acquire a write lock and recursively calculate the
928
930
// correct dispatch resolution
931
+ NPY_BEGIN_ALLOW_THREADS
929
932
mutex->lock ();
933
+ NPY_END_ALLOW_THREADS
930
934
info = promote_and_get_info_and_ufuncimpl (ufunc,
931
935
ops, signature, op_dtypes, legacy_promotion_is_possible);
932
936
mutex->unlock ();
You can’t perform that action at this time.
0 commit comments