| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,7 @@ def do_terminate_threads(whitelist=list()): | |||
| 21 | 21 | continue | |
| 22 | 22 | if whitelist and t not in whitelist: | |
| 23 | 23 | continue | |
| 24 | + t.schedule_termination() | ||
| 24 | 25 | t.stop_and_join() | |
| 25 | 26 | # END for each thread | |
| 26 | 27 | ||
@@ -76,7 +77,11 @@ def start(self): | |||
| 76 | 77 | ||
| 77 | 78 | #} END subclass interface | |
| 78 | 79 | ||
| 79 | - #{ Interface | ||
| 80 | + #{ Interface | ||
| 81 | + def schedule_termination(self): | ||
| 82 | + """Schedule this thread to be terminated as soon as possible. | ||
| 83 | + :note: this method does not block.""" | ||
| 84 | + self._terminate = True | ||
| 80 | 85 | ||
| 81 | 86 | def stop_and_join(self): | |
| 82 | 87 | """Ask the thread to stop its operation and wait for it to terminate | |
| Back | FazBrowse Home | New Git URL |
0 commit comments