Message47048
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. |
|
Date |
User |
Action |
Args |
2007-08-23 15:40:10 | admin | link | issue1044089 messages |
2007-08-23 15:40:10 | admin | create | |
|