From 5db49afafd30a206c40b74c5fd31cd627fce21cf Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 12 Oct 2023 02:10:50 +0200 Subject: [PATCH] Library/Application: now able to switch supervisor-thread in OutputDirector This, and the GUI thread prompted an further round of design extensions and rework of the thread-wrapper. Especially there is now support for self-managed threads, which can be launched and operate completely detached from the context used to start them. This resolves an occasional SEGFAULT at shutdown. An alternative (admittedly much simpler) solution would have been to create a fixed context in a static global variable and to attach a regular thread wrapper from there, managed through unique_ptr. It seems obvious that the new solution is preferable, since all the tricky technicalities are encapsulated now. --- src/steam/play/output-director.cpp | 11 ++++----- .../library/meta/late-bind-instance-test.cpp | 2 +- wiki/thinkPad.ichthyo.mm | 24 +++++++++++-------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/steam/play/output-director.cpp b/src/steam/play/output-director.cpp index f7683a874..6d1b1acec 100644 --- a/src/steam/play/output-director.cpp +++ b/src/steam/play/output-director.cpp @@ -31,7 +31,7 @@ #include "steam/play/output-director.hpp" #include "lib/thread.hpp" -using lib::Thread; +using lib::launchDetached; namespace steam { @@ -102,11 +102,10 @@ namespace play { if (not shutdown_initiated_) { shutdown_initiated_ = true; - Thread{"Output shutdown supervisor" - ,[=]{ - bringDown (completedSignal); - }} - .detach(); + launchDetached ("Output shutdown supervisor" + ,[=]{ + bringDown (completedSignal); + }); } } diff --git a/tests/library/meta/late-bind-instance-test.cpp b/tests/library/meta/late-bind-instance-test.cpp index 7da47cab8..384684ae5 100644 --- a/tests/library/meta/late-bind-instance-test.cpp +++ b/tests/library/meta/late-bind-instance-test.cpp @@ -163,7 +163,7 @@ namespace test { } - /** @test replacement happens uniformely on all kinds of tuples + /** @test replacement happens uniformly on all kinds of tuples */ void verify_cornerCases() diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 453e118b2..97422d7f6 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -65960,7 +65960,7 @@ - + @@ -66291,12 +66291,13 @@ - - + + - + + @@ -82469,19 +82470,22 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + - - - - + + + + + + +