8000 This commit fixes the issue gh-127865. · python/cpython@4193048 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4193048

Browse files
committed
This commit fixes the issue gh-127865.
1 parent 487fdbe commit 4193048

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/import.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ const char *
749749
_PyImport_ResolveNameWithPackageContext(const char *name)
750750
{
751751
#ifndef HAVE_THREAD_LOCAL
752-
PyThread_acquire_lock(EXTENSIONS.mutex, WAIT_LOCK);
752+
PyMutex_Lock(&EXTENSIONS.mutex);
753753
#endif
754754
if (PKGCONTEXT != NULL) {
755755
const char *p = strrchr(PKGCONTEXT, '.');
@@ -759,7 +759,7 @@ _PyImport_ResolveNameWithPackageContext(const char *name)
759759
}
760760
}
761761
#ifndef HAVE_THREAD_LOCAL
762-
PyThread_release_lock(EXTENSIONS.mutex);
762+
PyMutex_Unlock(&EXTENSIONS.mutex);
763763
#endif
764764
return name;
765765
}
@ 8000 @ -768,12 +768,12 @@ const char *
768768
_PyImport_SwapPackageContext(const char *newcontext)
769769
{
770770
#ifndef HAVE_THREAD_LOCAL
771-
PyThread_acquire_lock(EXTENSIONS.mutex, WAIT_LOCK);
771+
PyMutex_Lock(&EXTENSIONS.mutex);
772772
#endif
773773
const char *oldcontext = PKGCONTEXT;
774774
PKGCONTEXT = newcontext;
775775
#ifndef HAVE_THREAD_LOCAL
776-
PyThread_release_lock(EXTENSIONS.mutex);
776+
PyMutex_Unlock(&EXTENSIONS.mutex);
777777
#endif
778778
return oldcontext;
779779
}

0 commit comments

Comments
 (0)
1617
0