mirror of
https://github.com/python/cpython.git
synced 2025-11-10 10:32:04 +00:00
[3.13] gh-127865: Fix build failure for systems without thread local support (GH-127866) (GH-127882)
This PR fixes the build issue introduced by the commit628f6ebfrom GH-112207 on systems without thread local support. (cherry picked from commitf823910bbd) Co-authored-by: velemas <10437413+velemas@users.noreply.github.com>
This commit is contained in:
parent
d51c1444e3
commit
f21b38c1a2
2 changed files with 5 additions and 4 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
Fix build failure on systems without thread-locals support.
|
||||||
|
|
@ -747,7 +747,7 @@ const char *
|
||||||
_PyImport_ResolveNameWithPackageContext(const char *name)
|
_PyImport_ResolveNameWithPackageContext(const char *name)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_THREAD_LOCAL
|
#ifndef HAVE_THREAD_LOCAL
|
||||||
PyThread_acquire_lock(EXTENSIONS.mutex, WAIT_LOCK);
|
PyMutex_Lock(&EXTENSIONS.mutex);
|
||||||
#endif
|
#endif
|
||||||
if (PKGCONTEXT != NULL) {
|
if (PKGCONTEXT != NULL) {
|
||||||
const char *p = strrchr(PKGCONTEXT, '.');
|
const char *p = strrchr(PKGCONTEXT, '.');
|
||||||
|
|
@ -757,7 +757,7 @@ _PyImport_ResolveNameWithPackageContext(const char *name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef HAVE_THREAD_LOCAL
|
#ifndef HAVE_THREAD_LOCAL
|
||||||
PyThread_release_lock(EXTENSIONS.mutex);
|
PyMutex_Unlock(&EXTENSIONS.mutex);
|
||||||
#endif
|
#endif
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
@ -766,12 +766,12 @@ const char *
|
||||||
_PyImport_SwapPackageContext(const char *newcontext)
|
_PyImport_SwapPackageContext(const char *newcontext)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_THREAD_LOCAL
|
#ifndef HAVE_THREAD_LOCAL
|
||||||
PyThread_acquire_lock(EXTENSIONS.mutex, WAIT_LOCK);
|
PyMutex_Lock(&EXTENSIONS.mutex);
|
||||||
#endif
|
#endif
|
||||||
const char *oldcontext = PKGCONTEXT;
|
const char *oldcontext = PKGCONTEXT;
|
||||||
PKGCONTEXT = newcontext;
|
PKGCONTEXT = newcontext;
|
||||||
#ifndef HAVE_THREAD_LOCAL
|
#ifndef HAVE_THREAD_LOCAL
|
||||||
PyThread_release_lock(EXTENSIONS.mutex);
|
PyMutex_Unlock(&EXTENSIONS.mutex);
|
||||||
#endif
|
#endif
|
||||||
return oldcontext;
|
return oldcontext;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue