Skip to content

Commit e7c7af4

Browse files
committed
libuv: Most of the functions in uv.pxd don't need GIL
1 parent de7fe08 commit e7c7af4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

uvloop/handles/handle.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ cdef void __uv_close_handle_cb(uv.uv_handle_t* handle) with gil:
319319
cdef void __close_all_handles(Loop loop):
320320
uv.uv_walk(loop.uvloop, __uv_walk_close_all_handles_cb, <void*>loop) # void
321321

322-
cdef void __uv_walk_close_all_handles_cb(uv.uv_handle_t* handle, void* arg):
322+
cdef void __uv_walk_close_all_handles_cb(uv.uv_handle_t* handle, void* arg) with gil:
323323
cdef:
324324
Loop loop = <Loop>arg
325325
UVHandle h

uvloop/includes/uv.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from posix.types cimport gid_t, uid_t
44
from . cimport system
55

66

7-
cdef extern from "../vendor/libuv/include/uv.h":
7+
cdef extern from "../vendor/libuv/include/uv.h" nogil:
88
cdef int UV_EACCES
99
cdef int UV_EAGAIN
1010
cdef int UV_EALREADY
@@ -179,7 +179,7 @@ cdef extern from "../vendor/libuv/include/uv.h":
179179
const char* uv_err_name(int err)
180180

181181
# no "with gil" for uv_walk_cb, as uv_walk doesn't release GIL
182-
ctypedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg)
182+
ctypedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg) with gil
183183

184184
ctypedef void (*uv_close_cb)(uv_handle_t* handle) with gil
185185
ctypedef void (*uv_idle_cb)(uv_idle_t* handle) with gil

0 commit comments

Comments
 (0)