Input & Driver: Fix zombie processes on Unix (#39)

Linux/Unix requires that processes be waited, which is unfortunate as Windows lets us abandon them to the murderous whims of the OS. This PR adds Unix-specific behaviour to send a SIGINT before waiting on the process, and adds an additional thread per call for asset disposal on all platforms.

Closes #38.

---

* Close processes by SIGINT and wait on Unix

This seems to remedy the Linux-specific zombie processes. Addition of
nix as a dependency *should* be fine on Windows, since I believe it
compiles to an empty crate.

* Dispose of Tracks on auxiliary thread

This adds a mechanism for the mixer threads to perform potentially expensive deallocation/cleanup outside of the main loop, preventing deadline misses etc. This should make misbehaving `wait`s a bit more friendly.
This commit is contained in:
Kyle Simpson
2021-01-26 20:19:51 +00:00
committed by GitHub
parent a0e905a83f
commit fe2282cfde
7 changed files with 64 additions and 4 deletions

View File

@@ -52,6 +52,10 @@ version = "0.10"
[dependencies.futures]
version = "0.3"
[dependencies.nix]
version = "0.19"
optional = true
[dependencies.parking_lot]
optional = true
version = "0.11"
@@ -133,6 +137,7 @@ driver = [
"byteorder",
"discortp",
"flume",
"nix",
"parking_lot",
"rand",
"serenity-voice-model",