From b4338aa3ed2f5a5b09b3a0a27d7fab8d6ab7b51a Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Tue, 27 Jun 2023 19:54:02 +0200 Subject: [PATCH] Receiver - Calling `end()` will now wait for the receiver's thread to stop Sender - Calling `end()` will now wait for the sender's thread to stop --- source/birchwood/client/receiver.d | 3 +++ source/birchwood/client/sender.d | 3 +++ 2 files changed, 6 insertions(+) diff --git a/source/birchwood/client/receiver.d b/source/birchwood/client/receiver.d index a0bafa2..185bc28 100644 --- a/source/birchwood/client/receiver.d +++ b/source/birchwood/client/receiver.d @@ -244,5 +244,8 @@ public final class ReceiverThread : Thread // TODO: See above notes about libsnooze behaviour due // ... to usage in our context receiveEvent.notifyAll(); + + // Wait on the manager thread to end + join(); } } \ No newline at end of file diff --git a/source/birchwood/client/sender.d b/source/birchwood/client/sender.d index 2af5a1e..6d5382e 100644 --- a/source/birchwood/client/sender.d +++ b/source/birchwood/client/sender.d @@ -149,5 +149,8 @@ public final class SenderThread : Thread // TODO: See above notes about libsnooze behaviour due // ... to usage in our context sendEvent.notifyAll(); + + // Wait on the manager thread to end + join(); } } \ No newline at end of file