[Python-checkins] python/dist/src/Include pystate.h,2.27,2.28
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Sun Mar 28 21:24:29 EST 2004
Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2629/include
Modified Files:
pystate.h
Log Message:
Added a comment about the unreferenced PyThreadState.tick_counter
member.
Index: pystate.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pystate.h,v
retrieving revision 2.27
retrieving revision 2.28
diff -C2 -d -r2.27 -r2.28
*** pystate.h 24 Mar 2004 21:57:08 -0000 2.27
--- pystate.h 29 Mar 2004 02:24:26 -0000 2.28
***************
*** 75,79 ****
--- 75,86 ----
PyObject *dict;
+ /* tick_counter is incremented whenever the check_interval ticker
+ * reaches zero. The purpose is to give a useful measure of the number
+ * of interpreted bytecode instructions in a given thread. This
+ * extremely lightweight statistic collector may be of interest to
+ * profilers (like psyco.jit()), although nothing in the core uses it.
+ */
int tick_counter;
+
int gilstate_counter;
***************
*** 113,117 ****
#endif
! typedef
enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
PyGILState_STATE;
--- 120,124 ----
#endif
! typedef
enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
PyGILState_STATE;
***************
*** 120,126 ****
C API, regardless of the current state of Python, or of its
thread lock. This may be called as many times as desired
! by a thread so long as each call is matched with a call to
! PyGILState_Release(). In general, other thread-state APIs may
! be used between _Ensure() and _Release() calls, so long as the
thread-state is restored to its previous state before the Release().
For example, normal use of the Py_BEGIN_ALLOW_THREADS/
--- 127,133 ----
C API, regardless of the current state of Python, or of its
thread lock. This may be called as many times as desired
! by a thread so long as each call is matched with a call to
! PyGILState_Release(). In general, other thread-state APIs may
! be used between _Ensure() and _Release() calls, so long as the
thread-state is restored to its previous state before the Release().
For example, normal use of the Py_BEGIN_ALLOW_THREADS/
***************
*** 130,135 ****
PyGILState_Ensure() was called, and must be passed to
PyGILState_Release() to ensure Python is left in the same state. Even
! though recursive calls are allowed, these handles can *not* be shared -
! each unique call to PyGILState_Ensure must save the handle for its
call to PyGILState_Release.
--- 137,142 ----
PyGILState_Ensure() was called, and must be passed to
PyGILState_Release() to ensure Python is left in the same state. Even
! though recursive calls are allowed, these handles can *not* be shared -
! each unique call to PyGILState_Ensure must save the handle for its
call to PyGILState_Release.
***************
*** 142,149 ****
/* Release any resources previously acquired. After this call, Python's
state will be the same as it was prior to the corresponding
! PyGILState_Ensure() call (but generally this state will be unknown to
the caller, hence the use of the GILState API.)
! Every call to PyGILState_Ensure must be matched by a call to
PyGILState_Release on the same thread.
*/
--- 149,156 ----
/* Release any resources previously acquired. After this call, Python's
state will be the same as it was prior to the corresponding
! PyGILState_Ensure() call (but generally this state will be unknown to
the caller, hence the use of the GILState API.)
! Every call to PyGILState_Ensure must be matched by a call to
PyGILState_Release on the same thread.
*/
***************
*** 151,157 ****
/* Helper/diagnostic function - get the current thread state for
! this thread. May return NULL if no GILState API has been used
! on the current thread. Note the main thread always has such a
! thread-state, even if no auto-thread-state call has been made
on the main thread.
*/
--- 158,164 ----
/* Helper/diagnostic function - get the current thread state for
! this thread. May return NULL if no GILState API has been used
! on the current thread. Note the main thread always has such a
! thread-state, even if no auto-thread-state call has been made
on the main thread.
*/
More information about the Python-checkins
mailing list