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(
912912 npy_bool legacy_promotion_is_possible)
913913{
914914 std::shared_mutex *mutex = ((std::shared_mutex *)((PyArrayIdentityHash *)ufunc->_dispatch_cache )->mutex );
915+ NPY_BEGIN_ALLOW_THREADS
915916 mutex->lock_shared ();
917+ NPY_END_ALLOW_THREADS
916918 PyObject *info = PyArrayIdentityHash_GetItem (
917919 (PyArrayIdentityHash *)ufunc->_dispatch_cache ,
918920 (PyObject **)op_dtypes);
@@ -926,7 +928,9 @@ promote_and_get_info_and_ufuncimpl_with_locking(
926928
927929 // cache miss, need to acquire a write lock and recursively calculate the
928930 // correct dispatch resolution
931+ NPY_BEGIN_ALLOW_THREADS
929932 mutex->lock ();
933+ NPY_END_ALLOW_THREADS
930934 info = promote_and_get_info_and_ufuncimpl (ufunc,
931935 ops, signature, op_dtypes, legacy_promotion_is_possible);
932936 mutex->unlock ();
You can’t perform that action at this time.
0 commit comments