www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18621] New: core.sync.condition notify methods cannot be used


          Issue ID: 18621
           Summary: core.sync.condition notify methods cannot be used from
                    a (unix) signal handler
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: jking apache.org

Using core.stdc.signal I can set up a signal handler to handle SIGINT (^C),
however signal handlers have a limited set of things they can do.  The handler
must be nothrow and  nogc.

pthread_cond_signal and pthread_cond_broadcast are safe to call in a signal
handler and typically used to trigger shutdowns, however core.sync.condition
has no safe method that can be called to notify or notifyAll.

Would it be possible to add a "nothrow  nogc" safe version of these methods
that return an error code instead of throw so that core.sync.condition can be
used in a (unix) signal handler?  Thanks.

Mar 16 2018