Bug 23332 – core.sync.condition notify methods should be @nogc

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2022-09-12T12:20:42Z
Last change time
2022-11-25T10:12:55Z
Keywords
pull
Assigned to
No Owner
Creator
Garrett D'Amore

Comments

Comment #0 by garrett — 2022-09-12T12:20:42Z
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.)
Comment #1 by dlang-bot — 2022-09-14T08:28:26Z
@RazvanN7 created dlang/dmd pull request #14432 "Fix Issue 23332 - core.sync.condition notify methods should be @nogc" fixing this issue: - Fix Issue 23332 - core.sync.condition notify methods should be @nogc https://github.com/dlang/dmd/pull/14432
Comment #2 by dlang-bot — 2022-11-25T10:12:55Z
dlang/dmd pull request #14432 "Fix Issue 23332 - core.sync.condition notify methods should be @nogc" was merged into master: - a76ca7b261f698824e8801f845ecac10980b22e6 by RazvanN7: Fix Issue 23332 - core.sync.condition notify methods should be @nogc https://github.com/dlang/dmd/pull/14432