Skip to content

Commit

Permalink
Use a proper type for the thread indent.
Browse files Browse the repository at this point in the history
Fixes #172.

Thanks to @vstinner, @jamesjer, and @hroncok for discovering this
problem and suggesting a fix.
  • Loading branch information
1st1 committed Jun 25, 2018
1 parent d557492 commit 700582a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion uvloop/includes/stdlib.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cdef int ssl_SSL_ERROR_WANT_READ = ssl.SSL_ERROR_WANT_READ
cdef int ssl_SSL_ERROR_WANT_WRITE = ssl.SSL_ERROR_WANT_WRITE
cdef int ssl_SSL_ERROR_SYSCALL = ssl.SSL_ERROR_SYSCALL

cdef long MAIN_THREAD_ID = <long>threading.main_thread().ident
cdef uint64_t MAIN_THREAD_ID = <long>threading.main_thread().ident

cdef int subprocess_PIPE = subprocess.PIPE
cdef int subprocess_STDOUT = subprocess.STDOUT
Expand Down
2 changes: 1 addition & 1 deletion uvloop/loop.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cdef class Loop:
bint _running
bint _stopping

long _thread_id
uint64_t _thread_id
bint _thread_is_main

object _task_factory
Expand Down
2 changes: 1 addition & 1 deletion uvloop/loop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ cdef class Loop:
cdef inline _check_thread(self):
if self._thread_id == 0:
return
cdef long thread_id = PyThread_get_thread_ident()
cdef uint64_t thread_id = PyThread_get_thread_ident()
if thread_id != self._thread_id:
raise RuntimeError(
"Non-thread-safe operation invoked on an event loop other "
Expand Down

0 comments on commit 700582a

Please sign in to comment.