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 receives OwnerTerminated, 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 with dub 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 an
ownerTerminated 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)