Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
e7ba37ec
Commit
e7ba37ec
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Hacky workaround python bug - daemon threads continue to run after
threading module has been destroyed.
parent
2d9fcb18
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/utils/status.py
+20
-9
20 additions, 9 deletions
fsl/utils/status.py
with
20 additions
and
9 deletions
fsl/utils/status.py
+
20
−
9
View file @
e7ba37ec
...
...
@@ -150,14 +150,25 @@ class ClearThread(threading.Thread):
(via a call to :func:`clearStatus`).
"""
while
True
:
# http://bugs.python.org/issue14623
#
# When the main thread exits, daemon threads will
# continue to run after the threading module is
# destroyed. Calls to the Event methods can thus
# result in errors.
try
:
self
.
__vetoEvent
.
clear
()
self
.
__clearEvent
.
wait
()
self
.
__clearEvent
.
clear
()
while
True
:
if
not
self
.
__clearEvent
.
wait
(
self
.
__timeout
)
and
\
not
self
.
__vetoEvent
.
isSet
():
log
.
debug
(
'
Timeout - clearing status
'
)
clearStatus
()
self
.
__vetoEvent
.
clear
()
self
.
__clearEvent
.
wait
()
self
.
__clearEvent
.
clear
()
if
not
self
.
__clearEvent
.
wait
(
self
.
__timeout
)
and
\
not
self
.
__vetoEvent
.
isSet
():
log
.
debug
(
'
Timeout - clearing status
'
)
clearStatus
()
except
:
pass
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment