Skip to content

Commit a68f3c9

Browse files
committed
Use a proper type for the thread indent.
Fixes #172. Thanks to @vstinner, @jamesjer, and @hroncok for discovering this problem and suggesting a fix.
1 parent 9f7cedf commit a68f3c9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: uvloop/includes/stdlib.pxi

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cdef int ssl_SSL_ERROR_WANT_READ = ssl.SSL_ERROR_WANT_READ
125125
cdef int ssl_SSL_ERROR_WANT_WRITE = ssl.SSL_ERROR_WANT_WRITE
126126
cdef int ssl_SSL_ERROR_SYSCALL = ssl.SSL_ERROR_SYSCALL
127127

128-
cdef long MAIN_THREAD_ID = <long>threading.main_thread().ident
128+
cdef uint64_t MAIN_THREAD_ID = <long>threading.main_thread().ident
129129

130130
cdef int subprocess_PIPE = subprocess.PIPE
131131
cdef int subprocess_STDOUT = subprocess.STDOUT

Diff for: uvloop/loop.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ cdef class Loop:
4545
bint _running
4646
bint _stopping
4747

48-
long _thread_id
48+
uint64_t _thread_id
4949
bint _thread_is_main
5050

5151
object _task_factory

Diff for: uvloop/loop.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ cdef class Loop:
638638
cdef inline _check_thread(self):
639639
if self._thread_id == 0:
640640
return
641-
cdef long thread_id = PyThread_get_thread_ident()
641+
cdef uint64_t thread_id = PyThread_get_thread_ident()
642642
if thread_id != self._thread_id:
643643
raise RuntimeError(
644644
"Non-thread-safe operation invoked on an event loop other "

0 commit comments

Comments
 (0)