| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes #424
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
It's possible for the custom termination handlers to raise exceptions.
Indeed this was actually the case for utils._call(). They're especially
difficult to reach with tests, so make extra effort to insulate them.
Print any exceptions encountered as a regular traceback before exiting.
|
| |
|
|
|
|
|
| |
Make it explicit that we should not rely on 'finally' clauses to clean
up for us in the event of termination.
|
|
|
|
|
|
| |
Break these two functionalities into separate context managers.
The blocked() context manager now just uses the ignored() context manager when also ignoring.
|
|
|
|
|
|
|
| |
A simpler context manager for ignoring signals in a code block,
also takes a "discard" option to decide whether the pending signals
delivered during the code block should be discarded or left in place
to be treated upon exiting the context manager.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems that resuming tasks was not happening consistently, sometimes
resuming would fail to resume.
Changed the code to stop handling SIGCONT completely as to not add
any interference in the main child task's SIGCONT handling, instead
perform SIGCONT activities in the SIGTSTP handler, directly after
issuing SIGSTOP to self, where we implicitly know that if that code
is executed, it's because we have now resumed.
It's impossible to tell how correct this change is, however after
much testing this appears to be entirely reliable, whilst the previous
approach continues to be demonstrably unreliable.
|
|
This provides the terminator() and suspendable() context managers
previously hiding in utils.py.
Additionally, the suspendable() context manager is now recursive
like the terminator() is, so we can do more than one thing in
a suspendable context (like start/stop timers).
|