mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
This commit is contained in:
commit
e0ac2beb4f
2 changed files with 10 additions and 1 deletions
|
@ -201,6 +201,11 @@ Build
|
||||||
- Issue #23686: Update OS X 10.5 installer and Windows builds to use
|
- Issue #23686: Update OS X 10.5 installer and Windows builds to use
|
||||||
OpenSSL 1.0.2a.
|
OpenSSL 1.0.2a.
|
||||||
|
|
||||||
|
C API
|
||||||
|
-----
|
||||||
|
|
||||||
|
- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
|
||||||
|
|
||||||
|
|
||||||
What's New in Python 3.4.3?
|
What's New in Python 3.4.3?
|
||||||
===========================
|
===========================
|
||||||
|
|
|
@ -207,8 +207,12 @@ _PyImport_ReleaseLock(void)
|
||||||
void
|
void
|
||||||
_PyImport_ReInitLock(void)
|
_PyImport_ReInitLock(void)
|
||||||
{
|
{
|
||||||
if (import_lock != NULL)
|
if (import_lock != NULL) {
|
||||||
import_lock = PyThread_allocate_lock();
|
import_lock = PyThread_allocate_lock();
|
||||||
|
if (import_lock == NULL) {
|
||||||
|
Py_FatalError("PyImport_ReInitLock failed to create a new lock");
|
||||||
|
}
|
||||||
|
}
|
||||||
if (import_lock_level > 1) {
|
if (import_lock_level > 1) {
|
||||||
/* Forked as a side effect of import */
|
/* Forked as a side effect of import */
|
||||||
long me = PyThread_get_thread_ident();
|
long me = PyThread_get_thread_ident();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue