mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
bpo-39947: Add PyThreadState_GetID() function (GH-19163)
Add PyThreadState_GetID() function: get the unique identifier of a Python thread state.
This commit is contained in:
parent
0e427c6d15
commit
5c3cda0d1a
6 changed files with 25 additions and 2 deletions
|
@ -1021,6 +1021,14 @@ PyThreadState_GetFrame(PyThreadState *tstate)
|
|||
}
|
||||
|
||||
|
||||
uint64_t
|
||||
PyThreadState_GetID(PyThreadState *tstate)
|
||||
{
|
||||
assert(tstate != NULL);
|
||||
return tstate->id;
|
||||
}
|
||||
|
||||
|
||||
/* Asynchronously raise an exception in a thread.
|
||||
Requested by Just van Rossum and Alex Martelli.
|
||||
To prevent naive misuse, you must write your own extension
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue