mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-03 15:14:53 -04:00
Fixed potential daemon thread IO buffer deadlock on externally mediated shutdown signal
This commit is contained in:
parent
9e7641d2d3
commit
f030cf6f22
2 changed files with 16 additions and 9 deletions
|
@ -164,21 +164,23 @@ class Reticulum:
|
|||
__instance = None
|
||||
|
||||
__interface_detach_ran = False
|
||||
__exit_handler_ran = False
|
||||
@staticmethod
|
||||
def exit_handler():
|
||||
# This exit handler is called whenever Reticulum is asked to
|
||||
# shut down, and will in turn call exit handlers in other
|
||||
# classes, saving necessary information to disk and carrying
|
||||
# out cleanup operations.
|
||||
if not Reticulum.__interface_detach_ran:
|
||||
RNS.Transport.detach_interfaces()
|
||||
RNS.Transport.exit_handler()
|
||||
RNS.Identity.exit_handler()
|
||||
if not Reticulum.__exit_handler_ran:
|
||||
if not Reticulum.__interface_detach_ran:
|
||||
RNS.Transport.detach_interfaces()
|
||||
RNS.Transport.exit_handler()
|
||||
RNS.Identity.exit_handler()
|
||||
|
||||
if RNS.Profiler.ran():
|
||||
RNS.Profiler.results()
|
||||
if RNS.Profiler.ran():
|
||||
RNS.Profiler.results()
|
||||
|
||||
RNS.loglevel = -1
|
||||
RNS.loglevel = -1
|
||||
|
||||
@staticmethod
|
||||
def sigint_handler(signal, frame):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue