_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, '.');
}
}
#ifndef HAVE_THREAD_LOCAL
- PyThread_release_lock(EXTENSIONS.mutex);
+ PyMutex_Unlock(&EXTENSIONS.mutex);
#endif
return name;
}
_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;
}