www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15268] New: possible deadlock for

https://issues.dlang.org/show_bug.cgi?id=15268

          Issue ID: 15268
           Summary: possible deadlock for Thread.getAll/Thread.opApply w/
                    GC.collect
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

This is a classical lock inversion deadlock.
GC.collect -> gclock -> thread_suspendAll -> slock
Thread.getAll -> slock -> GC.malloc -> gclock

Anyone holding slock must not use the GC.

--
Oct 30 2015