How to kill whole application if child thread raises an exception?

dm via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 27 20:47:50 PDT 2016


On Friday, 28 October 2016 at 03:38:05 UTC, dm wrote:
> On Thursday, 27 October 2016 at 13:37:29 UTC, Steven 
> Schveighoffer wrote:
>> Hm... what about:
>> ...
>
> Main thread still running.

Actually it's depends on compiler.
With ldc2 main thread doesn't stop, but with dmd seems all ok:
root at proxytest:~# ./newthread
object.Exception at newthread.d(30): Everything is bad.
----------------
??:? void newthread.func() [0x451f52]
??:? void newthread.mySpawn!(void function()*).mySpawn(void 
function()*).callIt(void function()*) [0x452037]
??:? void std.concurrency._spawn!(void function(void 
function()*)*, void function()*)._spawn(bool, void function(void 
function()*)*, void function()*).exec() [0x4529f4]
??:? void core.thread.Thread.run() [0x46f1f1]
??:? thread_entryPoint [0x46ef1b]
??:? [0x42d00a3]
uncaught exception
dwarfeh(224) fatal error
Aborted



More information about the Digitalmars-d-learn mailing list