[Issue 4307] spawn()'ed thread doesn't terminate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 2 21:07:32 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4307



--- Comment #6 from Jonathan M Davis <jmdavisProg at gmx.com> 2010-11-02 21:06:34 PDT ---
Created an attachment (id=797)
Patch for core.thread for linux with changes based off of dmd 2.050.

Here's a patch for core.thread which appears to solve the problem on Linux.
Essentially, I made it so that you can give start() a bool to tell it to start
the thread as detached (as in pthread_detach(), not detached from the D
runtime), which I chose to call joinable (to distinguish from being detached
from the D runtime). So, spawn() can call thread.start(false), and then the
thread should terminate properly without needing to be joined. The changes are
essentially Posix only, so if this problem is also on Windows, then other
changes may be required for Windows and/or MacOS X, but I know essentially
nothing about threads on either of those systems. So, I don't know if this
patch is the best overall solution, but it does appear to fix the problem on
Linux, so even if it's not enough of a fix, it should at least help solve the
problem.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list