This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients
Date 2004-10-10.16:59:09
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Bug# 1011380 points out that locking operations such as
PyGILState_Ensure and PyGILState_Release should be
noop's if PyEval_InitThreads has not been called.

However, for reasons stated there, I dislike the
mechanism used in the patch supplied with the bug
report. The patch attached here uses a different mechanism:

 - within ceval.c, the PyEval_(Thread/Lock) functions
all use the existence of the GIL to check if
PyEval_InitThreads has been called. This matches
existing usage in ceval.c
 - a new API function PyEval_ThreadsInitialized() is
added to ceval.h that returns a true result only if the
GIL exists.
 - this new API is used by the PyGILState functions to
short-circuit their operation if the GIL does not exist.
History
Date User Action Args
2007-08-23 15:40:10adminlinkissue1044089 messages
2007-08-23 15:40:10admincreate