[Issue 18621] New: core.sync.condition notify methods cannot be used from a (unix) signal handler
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Mar 16 12:03:55 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18621
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 at puremagic.com
Reporter: jking at 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.
--
More information about the Digitalmars-d-bugs
mailing list