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.
This commit is contained in:
parent
29b9126c26
commit
5db49afafd
3 changed files with 20 additions and 17 deletions
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -65960,7 +65960,7 @@
|
|||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1696687299435" ID="ID_1271362386" MODIFIED="1696961347895" TEXT="Konfiguration ermöglichen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#5b280f" CREATED="1696687326411" ID="ID_682366843" MODIFIED="1696773642410" TEXT="BuilderQualfierSupport nutzbar machen">
|
||||
<node COLOR="#5b280f" CREATED="1696687326411" FOLDED="true" ID="ID_682366843" MODIFIED="1696773642410" TEXT="BuilderQualfierSupport nutzbar machen">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
<node COLOR="#435e98" CREATED="1696687354848" FOLDED="true" ID="ID_1619359990" MODIFIED="1696860882593" TEXT="Einsatz klären">
|
||||
<icon BUILTIN="info"/>
|
||||
|
|
@ -66291,12 +66291,13 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1696893013891" ID="ID_1856740667" MODIFIED="1696893025601" TEXT="damit bestehende Probleme im Applikations-Code lösen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1696893013891" ID="ID_1856740667" MODIFIED="1697068782982" TEXT="damit bestehende Probleme im Applikations-Code lösen">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node CREATED="1696893026770" ID="ID_253995958" MODIFIED="1696893031336" TEXT="GtkLumiera">
|
||||
<node CREATED="1696893056374" MODIFIED="1696893056374" TEXT="Variante-1"/>
|
||||
</node>
|
||||
<node CREATED="1696893037535" ID="ID_1340852722" MODIFIED="1696893043218" TEXT="OutputDirector">
|
||||
<node COLOR="#338800" CREATED="1696893037535" ID="ID_1340852722" MODIFIED="1697068777127" TEXT="OutputDirector">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1696893058148" MODIFIED="1696893058148" TEXT="Variante-1"/>
|
||||
</node>
|
||||
<node CREATED="1696893032057" ID="ID_926131453" MODIFIED="1696893046381" TEXT="SteamDispatcher">
|
||||
|
|
@ -82469,19 +82470,22 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<arrowlink COLOR="#bc3562" DESTINATION="ID_1146069423" ENDARROW="Default" ENDINCLINATION="444;909;" ID="Arrow_ID_516910789" STARTARROW="None" STARTINCLINATION="-1280;-32;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node CREATED="1696468692302" ID="ID_1299573982" MODIFIED="1696468713991" TEXT="SteamDispatcher und OutputDirector brauchen das ebenso">
|
||||
<arrowlink COLOR="#e71f4f" DESTINATION="ID_871343805" ENDARROW="Default" ENDINCLINATION="173;10;" ID="Arrow_ID_1685700346" STARTARROW="None" STARTINCLINATION="-14;8;"/>
|
||||
<node CREATED="1696468692302" ID="ID_1299573982" MODIFIED="1697068881651" TEXT="SteamDispatcher und OutputDirector brauchen das ebenso">
|
||||
<arrowlink COLOR="#1f9fe7" DESTINATION="ID_871343805" ENDARROW="Default" ENDINCLINATION="173;10;" ID="Arrow_ID_1685700346" STARTARROW="None" STARTINCLINATION="-8;8;"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1696029465122" ID="ID_871343805" MODIFIED="1696541248860" TEXT="output-director.cpp">
|
||||
<linktarget COLOR="#e71f4f" DESTINATION="ID_871343805" ENDARROW="Default" ENDINCLINATION="173;10;" ID="Arrow_ID_1685700346" SOURCE="ID_1299573982" STARTARROW="None" STARTINCLINATION="-14;8;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1696888656242" HGAP="33" ID="ID_1500509085" MODIFIED="1696888747350" STYLE="fork" TEXT="Symptom hier: bad_alloc im Shutdown" VSHIFT="17">
|
||||
<node COLOR="#338800" CREATED="1696029465122" ID="ID_871343805" MODIFIED="1697068873667" TEXT="output-director.cpp">
|
||||
<linktarget COLOR="#1f9fe7" DESTINATION="ID_871343805" ENDARROW="Default" ENDINCLINATION="173;10;" ID="Arrow_ID_1685700346" SOURCE="ID_1299573982" STARTARROW="None" STARTINCLINATION="-8;8;"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1696888656242" HGAP="36" ID="ID_1500509085" MODIFIED="1696888747350" STYLE="fork" TEXT="Symptom hier: bad_alloc im Shutdown" VSHIFT="25">
|
||||
<icon BUILTIN="broken-line"/>
|
||||
<node CREATED="1696888694193" ID="ID_1029299240" MODIFIED="1696888746935" TEXT="dtor des Threads stellt isLife() fest"/>
|
||||
<node CREATED="1696888714635" ID="ID_1361206868" MODIFIED="1696888746935" TEXT="versucht Warnung ausgzugeben"/>
|
||||
<node CREATED="1696888722382" ID="ID_1232713816" MODIFIED="1696888746935" TEXT="aber der string threadID ist bereits korrumpiert"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1697068823544" HGAP="49" ID="ID_180983339" MODIFIED="1697068856206" TEXT="gelöst nach Umstellung auf lib::launchDetached" VSHIFT="1">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5a3" COLOR="#883300" CREATED="1696029465122" ID="ID_556208204" MODIFIED="1696539012684" TEXT="steam-dispatcher.cpp">
|
||||
<linktarget COLOR="#71be6f" DESTINATION="ID_556208204" ENDARROW="Default" ENDINCLINATION="1038;-401;" ID="Arrow_ID_1257115855" SOURCE="ID_1718267866" STARTARROW="None" STARTINCLINATION="602;40;"/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue