Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
4324fad0
Commit
4324fad0
authored
Mar 02, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanups and comments during debugging of #1126
parent
0d12a273
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
13 deletions
+16
-13
src/gevent/_ffi/loop.py
src/gevent/_ffi/loop.py
+1
-2
src/gevent/_socketcommon.py
src/gevent/_socketcommon.py
+7
-7
src/gevent/libuv/_corecffi_cdef.c
src/gevent/libuv/_corecffi_cdef.c
+4
-0
src/gevent/libuv/_corecffi_source.c
src/gevent/libuv/_corecffi_source.c
+1
-0
src/gevent/libuv/watcher.py
src/gevent/libuv/watcher.py
+3
-4
No files found.
src/gevent/_ffi/loop.py
View file @
4324fad0
...
...
@@ -223,7 +223,6 @@ class AbstractCallbacks(object):
# NOTE: Raising exceptions here does nothing, they're swallowed by CFFI.
# Since the C level passed in a null pointer, even dereferencing the handle
# will just produce some exceptions.
if
GEVENT_DEBUG_LEVEL
<
CRITICAL
:
return
_dbg
(
"python_stop: stopping watcher with handle"
,
handle
)
watcher
=
self
.
from_handle
(
handle
)
...
...
src/gevent/_socketcommon.py
View file @
4324fad0
...
...
@@ -157,15 +157,15 @@ def wait(io, timeout=None, timeout_exc=_NONE):
"""
if
io
.
callback
is
not
None
:
raise
ConcurrentObjectUseError
(
'This socket is already used by another greenlet: %r'
%
(
io
.
callback
,
))
if
timeout
is
not
None
:
timeout_exc
=
timeout_exc
if
timeout_exc
is
not
_NONE
else
_timeout_error
(
'timed out'
)
timeout
=
Timeout
.
start_new
(
timeout
,
timeout_exc
)
timeout
=
Timeout
.
_start_new_or_dummy
(
timeout
,
(
timeout_exc
if
timeout_exc
is
not
_NONE
or
timeout
is
None
else
_timeout_error
(
'timed out'
)))
try
:
with
timeout
:
return
get_hub
().
wait
(
io
)
finally
:
if
timeout
is
not
None
:
timeout
.
cancel
()
# rename "io" to "watcher" because wait() works with any watcher
...
...
src/gevent/libuv/_corecffi_cdef.c
View file @
4324fad0
...
...
@@ -164,6 +164,8 @@ typedef struct uv_fs_event_s uv_fs_event_t;
typedef
struct
uv_fs_poll_s
uv_fs_poll_t
;
size_t
uv_handle_size
(
uv_handle_type
);
// callbacks with the same signature
// XXX: Note that these, and all callbacks, are defined to take
// a void* or handle* instead of the more specific, correct,
...
...
@@ -338,6 +340,8 @@ int uv_fs_poll_start(void*, uv_fs_poll_cb, const char* path, unsigned int);
int
uv_fs_poll_stop
(
void
*
);
/* Standard library */
void
*
memset
(
void
*
b
,
int
c
,
size_t
len
);
/* gevent callbacks */
...
...
src/gevent/libuv/_corecffi_source.c
View file @
4324fad0
#include <string.h>
#include "uv.h"
static
int
python_callback
(
void
*
handle
,
int
revents
);
...
...
src/gevent/libuv/watcher.py
View file @
4324fad0
...
...
@@ -120,7 +120,7 @@ class watcher(_base.watcher):
# Instead, this is arranged as a callback to GC when the
# watcher class dies. Obviously it's important to keep the ffi
# watcher alive.
_dbg
(
"Request to close handle"
,
ffi_watcher
)
_dbg
(
"Request to close handle"
,
ffi
.
cast
(
'void*'
,
ffi_watcher
),
ffi
_watcher
)
# We can pass in "subclasses" if uv_handle_t that line up at the C level,
# but that don't in CFFI without a cast. But be careful what we use the cast
# for, don't pass it back to C.
...
...
@@ -725,7 +725,6 @@ class idle(_base.IdleMixin, watcher):
class
check
(
_base
.
CheckMixin
,
watcher
):
pass
class
OneShotCheck
(
check
):
_watcher_skip_ffi
=
True
...
...
@@ -733,8 +732,8 @@ class OneShotCheck(check):
def
__make_cb
(
self
,
func
):
stop
=
self
.
stop
@
functools
.
wraps
(
func
)
def
cb
(
*
args
,
_stop
=
stop
):
_
stop
()
def
cb
(
*
args
):
stop
()
return
func
(
*
args
)
return
cb
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment