Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
271b27e5
Commit
271b27e5
authored
Apr 05, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #11768: add debug messages in test_threadsignals.test_signals
parent
fe7c5b5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Lib/test/test_threadsignals.py
Lib/test/test_threadsignals.py
+8
-0
No files found.
Lib/test/test_threadsignals.py
View file @
271b27e5
...
...
@@ -30,9 +30,14 @@ def handle_signals(sig,frame):
# a function that will be spawned as a separate thread.
def
send_signals
():
print
(
"send_signals: enter (thread %s)"
%
thread
.
get_ident
(),
file
=
sys
.
stderr
)
print
(
"send_signals: raise SIGUSR1"
,
file
=
sys
.
stderr
)
os
.
kill
(
process_pid
,
signal
.
SIGUSR1
)
print
(
"send_signals: raise SIGUSR2"
,
file
=
sys
.
stderr
)
os
.
kill
(
process_pid
,
signal
.
SIGUSR2
)
print
(
"send_signals: release signalled_all"
,
file
=
sys
.
stderr
)
signalled_all
.
release
()
print
(
"send_signals: exit (thread %s)"
%
thread
.
get_ident
(),
file
=
sys
.
stderr
)
class
ThreadSignals
(
unittest
.
TestCase
):
...
...
@@ -41,9 +46,12 @@ class ThreadSignals(unittest.TestCase):
# We spawn a thread, have the thread send two signals, and
# wait for it to finish. Check that we got both signals
# and that they were run by the main thread.
print
(
"test_signals: acquire lock (thread %s)"
%
thread
.
get_ident
(),
file
=
sys
.
stderr
)
signalled_all
.
acquire
()
self
.
spawnSignallingThread
()
print
(
"test_signals: wait lock (thread %s)"
%
thread
.
get_ident
(),
file
=
sys
.
stderr
)
signalled_all
.
acquire
()
print
(
"test_signals: lock acquired"
,
file
=
sys
.
stderr
)
# the signals that we asked the kernel to send
# will come back, but we don't know when.
# (it might even be after the thread exits
...
...
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