[Issue 23332] New: core.sync.condition notify methods should be @nogc
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 12 12:20:42 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23332
Issue ID: 23332
Summary: core.sync.condition notify methods should be @nogc
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: enhancement
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: garrett at damore.org
It would be desirable to be able to notify a condition from @nogc code.
Underneath, neither Windows nor POSIX require an allocation.
However, the D implementation of this library attempts to handle any error that
comes from the pthread_cond_signal or pthread_cond_broadcast calls and turns
them into a thrown exceeption.
In general, these calls cannot fail on any system, unless they are provided
with invalid inputs. Given that, it would be IMO perfectly reasonable to turn
this into a runtime error condition (e.g. via an assert or following the method
done for sync.mutex.Mutex.)
--
More information about the Digitalmars-d-bugs
mailing list