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
7907a2f8
Commit
7907a2f8
authored
Jan 22, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline stop
parent
75917789
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
src/gevent/libev/corecext.ppyx
src/gevent/libev/corecext.ppyx
+20
-14
No files found.
src/gevent/libev/corecext.ppyx
View file @
7907a2f8
...
@@ -668,21 +668,11 @@ cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback
...
@@ -668,21 +668,11 @@ cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback
#define WATCHER(TYPE) \
#define WATCHER(TYPE) \
cdef libev.ev_##TYPE _watcher \
cdef libev.ev_##TYPE _watcher \
\
\
def stop(self): \
_check_loop(self.loop) \
if self._flags & 2: \
libev.ev_ref(self.loop._ptr) \
self._flags &= ~2 \
libev.ev_##TYPE##_stop(self.loop._ptr, &self._watcher) \
self._callback = None \
self.args = None \
if self._flags & 1: \
Py_DECREF(<PyObjectPtr>self) \
self._flags &= ~1 \
\
cdef void _do_libev_start(self): \
cdef void _do_libev_start(self): \
libev.ev_##TYPE##_start(self.loop._ptr, &self._watcher)
libev.ev_##TYPE##_start(self.loop._ptr, &self._watcher) \
\
cdef void _do_libev_stop(self): \
libev.ev_##TYPE##_stop(self.loop._ptr, &self._watcher) \
cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]:
cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]:
...
@@ -767,6 +757,22 @@ cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Ty
...
@@ -767,6 +757,22 @@ cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Ty
# This is not allowed to fail, and must be implemented by subclasses.
# This is not allowed to fail, and must be implemented by subclasses.
return
return
def stop(self):
_check_loop(self.loop)
if self._flags & 2:
libev.ev_ref(self.loop._ptr)
self._flags &= ~2
self._do_libev_stop()
self._callback = None
self.args = None
if self._flags & 1:
Py_DECREF(<PyObjectPtr>self)
self._flags &= ~1
cdef void _do_libev_stop(self):
# like _do_libev_start
return
def feed(self, int revents, object callback, *args):
def feed(self, int revents, object callback, *args):
_check_loop(self.loop)
_check_loop(self.loop)
self.callback = callback
self.callback = callback
...
...
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