mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
fixed process waiting
This commit is contained in:
@@ -230,7 +230,7 @@ class BaseMcuHid(BaseHid, multiprocessing.Process): # pylint: disable=too-many-
|
||||
if self.is_alive():
|
||||
get_logger(0).info("Stopping HID daemon ...")
|
||||
self.__stop_event.set()
|
||||
if self.exitcode is not None:
|
||||
if self.is_alive() or self.exitcode is not None:
|
||||
self.join()
|
||||
|
||||
# =====
|
||||
|
||||
@@ -170,7 +170,7 @@ class Plugin(BaseHid): # pylint: disable=too-many-instance-attributes
|
||||
if self.__proc.is_alive():
|
||||
get_logger(0).info("Stopping HID daemon ...")
|
||||
self.__stop_event.set()
|
||||
if self.__proc.exitcode is not None:
|
||||
if self.__proc.is_alive() or self.__proc.exitcode is not None:
|
||||
self.__proc.join()
|
||||
|
||||
# =====
|
||||
|
||||
@@ -122,7 +122,7 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in
|
||||
if self.is_alive():
|
||||
get_logger().info("Stopping HID-%s daemon ...", self.__name)
|
||||
self.__stop_event.set()
|
||||
if self.exitcode is not None:
|
||||
if self.is_alive() or self.exitcode is not None:
|
||||
self.join()
|
||||
|
||||
def _queue_event(self, event: BaseEvent) -> None:
|
||||
|
||||
@@ -110,7 +110,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
|
||||
if self.__proc.is_alive():
|
||||
get_logger(0).info("Stopping %s daemon ...", self)
|
||||
self.__stop_event.set()
|
||||
if self.__proc.exitcode is not None:
|
||||
if self.__proc.is_alive() or self.__proc.exitcode is not None:
|
||||
self.__proc.join()
|
||||
|
||||
async def read(self, pin: int) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user