Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
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
Joanne Hugé
re6stnet
Commits
2c5cf691
Commit
2c5cf691
authored
May 18, 2021
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the way signals are handled
Make it so that the demo can be interrupted while a test is running
parent
0f97c026
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
demo/demo
demo/demo
+13
-4
No files found.
demo/demo
View file @
2c5cf691
...
@@ -43,10 +43,19 @@ with open(os.devnull, "wb") as f:
...
@@ -43,10 +43,19 @@ with open(os.devnull, "wb") as f:
# m1-m2-m3-m4-m5-m6-m7-m8 m10
# m1-m2-m3-m4-m5-m6-m7-m8 m10
# :2:: :4:: :6:: :8::
# :2:: :4:: :6:: :8::
def disable_signal_on_children(sig):
# When request_stop is true, subprocess know they need to exit
pid = os.getpid()
# and execute their exit routine
sigint = signal.signal(sig, lambda *x: os.getpid() == pid and sigint(*x))
request_stop = False
disable_signal_on_children(signal.SIGINT)
pid = os.getpid()
sigint = signal.getsignal(signal.SIGINT)
def sigint_handler(*x):
global request_stop
if os.getpid() == pid:
request_stop = True
sigint(*x)
signal.signal(signal.SIGINT, sigint_handler)
Node__add_interface = nemu.Node._add_interface
Node__add_interface = nemu.Node._add_interface
def _add_interface(node, iface):
def _add_interface(node, iface):
...
...
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