Skip to content

Commit d3841c5

Browse files
Merge pull request #5267 from swiftwasm/release/5.8
[pull] swiftwasm-release/5.8 from release/5.8
2 parents 8ecabce + 041d9de commit d3841c5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

stdlib/public/Concurrency/TaskGroup.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
#include <android/log.h>
4646
#endif
4747

48+
#if __has_include(<unistd.h>)
49+
#include <unistd.h>
50+
#endif
51+
4852
#if defined(_WIN32)
4953
#include <io.h>
5054
#endif
@@ -572,10 +576,10 @@ struct TaskGroupStatus {
572576
#if defined(_WIN32)
573577
#define STDERR_FILENO 2
574578
_write(STDERR_FILENO, message, strlen(message));
575-
#else
579+
#elif defined(STDERR_FILENO)
576580
write(STDERR_FILENO, message, strlen(message));
577581
#endif
578-
#if defined(__APPLE__)
582+
#if defined(SWIFT_STDLIB_HAS_ASL)
579583
asl_log(nullptr, nullptr, ASL_LEVEL_ERR, "%s", message);
580584
#elif defined(__ANDROID__)
581585
__android_log_print(ANDROID_LOG_FATAL, "SwiftRuntime", "%s", message);
@@ -1082,6 +1086,15 @@ static void _enqueueCompletedTask(NaiveTaskGroupQueue<ReadyQueueItem> *readyQueu
10821086
readyQueue->enqueue(readyItem);
10831087
}
10841088

1089+
#if SWIFT_CONCURRENCY_TASK_TO_THREAD_MODEL
1090+
static void _enqueueRawError(DiscardingTaskGroup *group,
1091+
NaiveTaskGroupQueue<ReadyQueueItem> *readyQueue,
1092+
SwiftError *error) {
1093+
auto readyItem = ReadyQueueItem::getRawError(group, error);
1094+
readyQueue->enqueue(readyItem);
1095+
}
1096+
#endif
1097+
10851098
// TaskGroup is locked upon entry and exit
10861099
void AccumulatingTaskGroup::enqueueCompletedTask(AsyncTask *completedTask, bool hadErrorResult) {
10871100
// Retain the task while it is in the queue; it must remain alive until

0 commit comments

Comments
 (0)