Am Wed, 1 Jul 2015 12:59:30 +0200
schrieb Marc Schütz schuetzm@gmx.net:
Thanks, I'll try that. Another related question:
I have a worker thread running in parallel with the main thread. This
worker thread exits when it receivesOwnerTerminated
, and it used to
shut down cleanly when the program was terminated, e.g. by SIGINT.
However, something has changed lately, and I can't figure out what it
is. When I run the program withdub
and press Ctrl-C, it prints
"Received signal 2. Shutting down.", but actually keeps running (in
the background,dub
itself exits). The worker thread doesn't
received anownerTerminated
signal anymore, though I can't tell for
sure whether this part actually worked that way before, I only know
that it exited.Do you have an idea what could have caused this? It only happend
yesterday, and I usually follow vibe.d's (and druntime's/Phobos') Git
closely, so there are not that many candidates. But I tried with older
vibe.d versions, and it still doesn't quit cleanly.Failing that, is there a way to detect when a shutdown has been
requested, so that I can notify my worker thread manually?(openSUSE 13.2 x86_64, libevent 2.0.21)
Nevermind, I found this:
http://dlang.org/phobos/core_thread.html#.Thread.isDaemon
Setting this in my worker thread makes it work correctly, including theOwnerTerminated
message.