mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-127865: Fix build failure for systems without thread local support (GH-127866)
This PR fixes the build issue introduced by the commit 628f6eb
from
GH-112207 on systems without thread local support.
This commit is contained in:
parent
f8dcb82006
commit
f823910bbd
2 changed files with 5 additions and 4 deletions
|
@ -0,0 +1 @@
|
|||
Fix build failure on systems without thread-locals support.
|
|
@ -749,7 +749,7 @@ const char *
|
|||
_PyImport_ResolveNameWithPackageContext(const char *name)
|
||||
{
|
||||
#ifndef HAVE_THREAD_LOCAL
|
||||
PyThread_acquire_lock(EXTENSIONS.mutex, WAIT_LOCK);
|
||||
PyMutex_Lock(&EXTENSIONS.mutex);
|
||||
#endif
|
||||
if (PKGCONTEXT != NULL) {
|
||||
const char *p = strrchr(PKGCONTEXT, '.');
|
||||
|
@ -759,7 +759,7 @@ _PyImport_ResolveNameWithPackageContext(const char *name)
|
|||
}
|
||||
}
|
||||
#ifndef HAVE_THREAD_LOCAL
|
||||
PyThread_release_lock(EXTENSIONS.mutex);
|
||||
PyMutex_Unlock(&EXTENSIONS.mutex);
|
||||
#endif
|
||||
return name;
|
||||
}
|
||||
|
@ -768,12 +768,12 @@ const char *
|
|||
_PyImport_SwapPackageContext(const char *newcontext)
|
||||
{
|
||||
#ifndef HAVE_THREAD_LOCAL
|
||||
PyThread_acquire_lock(EXTENSIONS.mutex, WAIT_LOCK);
|
||||
PyMutex_Lock(&EXTENSIONS.mutex);
|
||||
#endif
|
||||
const char *oldcontext = PKGCONTEXT;
|
||||
PKGCONTEXT = newcontext;
|
||||
#ifndef HAVE_THREAD_LOCAL
|
||||
PyThread_release_lock(EXTENSIONS.mutex);
|
||||
PyMutex_Unlock(&EXTENSIONS.mutex);
|
||||
#endif
|
||||
return oldcontext;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue