Merge pull request #518 from analogjupiter/event-set

Call `event.setIfInitialized` if available
This commit is contained in:
Adam D. Ruppe 2025-11-22 08:25:17 -05:00 committed by GitHub
commit 736477b128
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 2 deletions

12
core.d
View File

@ -9486,8 +9486,14 @@ class LoggerOf(T, size_t bufferSize = 16) : SynchronizableObject {
logger.condition.notifyAll(); logger.condition.notifyAll();
} }
// mark us as complete for other listeners waiting as well // mark us as complete for other listeners waiting as well
static if (__traits(hasMember, event, "setIfInitialized")) {
// Upstream compatibility, see <https://github.com/dlang/dmd/pull/15800>.
event.setIfInitialized();
} else {
// Old D runtime compatibility
event.set(); event.set();
} }
}
+/ +/
try { try {
@ -9537,7 +9543,13 @@ class LoggerOf(T, size_t bufferSize = 16) : SynchronizableObject {
logger.condition.notifyAll(); logger.condition.notifyAll();
} }
// mark us as complete for other listeners waiting as well // mark us as complete for other listeners waiting as well
static if (__traits(hasMember, event, "setIfInitialized")) {
// Upstream compatibility, see <https://github.com/dlang/dmd/pull/15800>.
event.setIfInitialized();
} else {
// Old D runtime compatibility
event.set(); event.set();
}
} }