www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10976] New: thread_joinAll after main exit performed too late

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10976

           Summary: thread_joinAll after main exit performed too late
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: code dawg.eu



Because we moved the rt_init/rt_term code into the .ctors/.dtors of druntime
the
implicit thread_joinAll is called too late, i.e. after the shared static
destructors are run.
This might crash or hang other running threads.

https://github.com/D-Programming-Language/druntime/pull/590

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 05 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10976


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/druntime/pull/600

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 05 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10976




Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/7d82a57c82f9a5359468680f36aa1026243e6f9e
fix Issue 10976 - thread_joinAll after main exit performed too late

- Move thread_joinAll out of rt_term and call it
  immediately after exiting from main instead.
- Make it an error to call rt_term when other non-daemon
  threads are still running.
- It was not a good idea to call thread_joinAll in rt_term
  because with DLLs threads could have been attached and
  outlive the runtime.
- As a side effect it will be called before `static ~this()`
  of the main thread is run.

https://github.com/D-Programming-Language/druntime/commit/db772968244bf5af37a81060758a1f266e0b698f


fix Issue 10976 - thread_joinAll after main exit performed too late

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 17 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10976


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |braddr puremagic.com



---
Anything left to fix or should this bug be closed?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 06 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10976


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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