Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
10239ec8
Commit
10239ec8
authored
Mar 29, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a comment about the unreferenced PyThreadState.tick_counter
member.
parent
b387d9a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
Include/pystate.h
Include/pystate.h
+18
-11
No files found.
Include/pystate.h
View file @
10239ec8
...
@@ -74,7 +74,14 @@ typedef struct _ts {
...
@@ -74,7 +74,14 @@ typedef struct _ts {
PyObject
*
dict
;
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
tick_counter
;
int
gilstate_counter
;
int
gilstate_counter
;
PyObject
*
async_exc
;
/* Asynchronous exception to raise */
PyObject
*
async_exc
;
/* Asynchronous exception to raise */
...
@@ -112,16 +119,16 @@ PyAPI_DATA(PyThreadState *) _PyThreadState_Current;
...
@@ -112,16 +119,16 @@ PyAPI_DATA(PyThreadState *) _PyThreadState_Current;
#define PyThreadState_GET() (_PyThreadState_Current)
#define PyThreadState_GET() (_PyThreadState_Current)
#endif
#endif
typedef
typedef
enum
{
PyGILState_LOCKED
,
PyGILState_UNLOCKED
}
enum
{
PyGILState_LOCKED
,
PyGILState_UNLOCKED
}
PyGILState_STATE
;
PyGILState_STATE
;
/* Ensure that the current thread is ready to call the Python
/* Ensure that the current thread is ready to call the Python
C API, regardless of the current state of Python, or of its
C API, regardless of the current state of Python, or of its
thread lock. This may be called as many times as desired
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
by a thread so long as each call is matched with a call to
PyGILState_Release(). In general, other thread-state APIs may
PyGILState_Release(). In general, other thread-state APIs may
be used between _Ensure() and _Release() calls, so long as the
be used between _Ensure() and _Release() calls, so long as the
thread-state is restored to its previous state before the Release().
thread-state is restored to its previous state before the Release().
For example, normal use of the Py_BEGIN_ALLOW_THREADS/
For example, normal use of the Py_BEGIN_ALLOW_THREADS/
Py_END_ALLOW_THREADS macros are acceptable.
Py_END_ALLOW_THREADS macros are acceptable.
...
@@ -129,8 +136,8 @@ typedef
...
@@ -129,8 +136,8 @@ typedef
The return value is an opaque "handle" to the thread state when
The return value is an opaque "handle" to the thread state when
PyGILState_Ensure() was called, and must be passed to
PyGILState_Ensure() was called, and must be passed to
PyGILState_Release() to ensure Python is left in the same state. Even
PyGILState_Release() to ensure Python is left in the same state. Even
though recursive calls are allowed, these handles can *not* be shared -
though recursive calls are allowed, these handles can *not* be shared -
each unique call to PyGILState_Ensure must save the handle for its
each unique call to PyGILState_Ensure must save the handle for its
call to PyGILState_Release.
call to PyGILState_Release.
When the function returns, the current thread will hold the GIL.
When the function returns, the current thread will hold the GIL.
...
@@ -141,18 +148,18 @@ PyAPI_FUNC(PyGILState_STATE) PyGILState_Ensure(void);
...
@@ -141,18 +148,18 @@ PyAPI_FUNC(PyGILState_STATE) PyGILState_Ensure(void);
/* Release any resources previously acquired. After this call, Python's
/* Release any resources previously acquired. After this call, Python's
state will be the same as it was prior to the corresponding
state will be the same as it was prior to the corresponding
PyGILState_Ensure() call (but generally this state will be unknown to
PyGILState_Ensure() call (but generally this state will be unknown to
the caller, hence the use of the GILState API.)
the caller, hence the use of the GILState API.)
Every call to PyGILState_Ensure must be matched by a call to
Every call to PyGILState_Ensure must be matched by a call to
PyGILState_Release on the same thread.
PyGILState_Release on the same thread.
*/
*/
PyAPI_FUNC
(
void
)
PyGILState_Release
(
PyGILState_STATE
);
PyAPI_FUNC
(
void
)
PyGILState_Release
(
PyGILState_STATE
);
/* Helper/diagnostic function - get the current thread state for
/* Helper/diagnostic function - get the current thread state for
this thread. May return NULL if no GILState API has been used
this thread. May return NULL if no GILState API has been used
on the current thread. Note the main thread always has such a
on the current thread. Note the main thread always has such a
thread-state, even if no auto-thread-state call has been made
thread-state, even if no auto-thread-state call has been made
on the main thread.
on the main thread.
*/
*/
PyAPI_FUNC
(
PyThreadState
*
)
PyGILState_GetThisThreadState
(
void
);
PyAPI_FUNC
(
PyThreadState
*
)
PyGILState_GetThisThreadState
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment