Call `event.setIfInitialized` if available

This commit is contained in:
Mindy Batek 2025-11-22 04:32:28 +01:00
parent cea860a447
commit 2ab06d1249
1 changed files with 14 additions and 2 deletions

16
core.d
View File

@ -9486,7 +9486,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
event.set(); 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();
}
} }
+/ +/
@ -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
event.set(); 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();
}
} }