[D-runtime] A mechanism to kill threads

Jonathan M Davis jmdavisProg at gmx.com
Wed May 16 11:47:48 PDT 2012


On Wednesday, May 16, 2012 19:04:48 Alex Rønne Petersen wrote:
> Hi,
> 
> In my virtual machine, I need to be able to kill daemon threads on
> shutdown. The problem is that VM shutdown is *not* tightly coupled to
> druntime shutdown; multiple VM instances can run in a process at any
> given time, and can be started/stopped whenever. It doesn't appear
> like there is any functionality in core.thread to achieve this.
> 
> Is there any reason we don't have a Thread.kill() function?

Because it's incredibly unsafe? You may have a valid use case for it, but it's 
_not_ something that you should normally be doing.

- Jonathan M Davis


More information about the D-runtime mailing list