diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-23 13:48:39 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-03-23 13:48:39 (GMT) |
commit | aefa7ebf0ff0f73feee7ab24f4cdcb2014d83ee5 (patch) | |
tree | 39560da26771d1e10add697e558bb727639fdbb0 /Modules/signalmodule.c | |
parent | 1e2147b9d75a64df370a9393c2b5b9d170dc0afd (diff) | |
download | cpython-aefa7ebf0ff0f73feee7ab24f4cdcb2014d83ee5.zip cpython-aefa7ebf0ff0f73feee7ab24f4cdcb2014d83ee5.tar.gz cpython-aefa7ebf0ff0f73feee7ab24f4cdcb2014d83ee5.tar.bz2 |
bpo-6532: Make the thread id an unsigned integer. (#781)
* bpo-6532: Make the thread id an unsigned integer.
From C API side the type of results of PyThread_start_new_thread() and
PyThread_get_thread_ident(), the id parameter of
PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState
changed from "long" to "unsigned long".
* Restore a check in thread_get_ident().
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r-- | Modules/signalmodule.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index bc36d41..ed03683 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -88,7 +88,7 @@ module signal #ifdef WITH_THREAD #include <sys/types.h> /* For pid_t */ #include "pythread.h" -static long main_thread; +static unsigned long main_thread; static pid_t main_pid; #endif @@ -1088,7 +1088,7 @@ signal_sigtimedwait_impl(PyObject *module, PyObject *sigset, /*[clinic input] signal.pthread_kill - thread_id: long + thread_id: unsigned_long(bitwise=True) signalnum: int / @@ -1096,8 +1096,9 @@ Send a signal to a thread. [clinic start generated code]*/ static PyObject * -signal_pthread_kill_impl(PyObject *module, long thread_id, int signalnum) -/*[clinic end generated code: output=2a09ce41f1c4228a input=77ed6a3b6f2a8122]*/ +signal_pthread_kill_impl(PyObject *module, unsigned long thread_id, + int signalnum) +/*[clinic end generated code: output=7629919b791bc27f input=1d901f2c7bb544ff]*/ { int err; |