Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shrapnel
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
shrapnel
Commits
0f4547dd
Commit
0f4547dd
authored
Nov 02, 2014
by
Sam Rushing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coro.fork: hack to create new kqueue() fd upon fork for unix-style forking servers.
parent
a76e22d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
coro/_coro.pyx
coro/_coro.pyx
+11
-0
No files found.
coro/_coro.pyx
View file @
0f4547dd
...
...
@@ -65,6 +65,7 @@ from cpython.ref cimport Py_DECREF, Py_INCREF
from
cpython.mem
cimport
PyMem_Free
,
PyMem_Malloc
from
cpython.list
cimport
PyList_New
from
cpython.bytes
cimport
PyBytes_FromStringAndSize
from
posix.unistd
cimport
fork
as
posix_fork
cdef
extern
from
"Python.h"
:
ctypedef
struct
PyThreadState
:
...
...
@@ -1274,6 +1275,14 @@ cdef public class sched [ object sched_object, type sched_type ]:
if
_print_exit_string
:
print_stderr
(
'Exiting...
\
n
'
)
def
fork
(
self
):
cdef
int
result
=
posix_fork
()
if
result
==
0
:
the_poller
.
tear_down
()
the_poller
.
set_up
()
return
result
# FOR EXTERNAL CONSUMPTION, do not call from within this file,
# because it is declared void. [void functions cannot propagate
# exceptions]
...
...
@@ -1461,6 +1470,8 @@ with_timeout = the_scheduler.with_timeout
sleep_relative
=
the_scheduler
.
sleep_relative
sleep_absolute
=
the_scheduler
.
sleep_absolute
set_latency_warning
=
the_scheduler
.
set_latency_warning
fork
=
the_scheduler
.
fork
set_handler
=
the_poller
.
set_handler
event_map
=
the_poller
.
event_map
wait_for
=
the_poller
.
wait_for
...
...
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