|
45 | 45 | #include <android/log.h>
|
46 | 46 | #endif
|
47 | 47 |
|
| 48 | +#if __has_include(<unistd.h>) |
| 49 | +#include <unistd.h> |
| 50 | +#endif |
| 51 | + |
48 | 52 | #if defined(_WIN32)
|
49 | 53 | #include <io.h>
|
50 | 54 | #endif
|
@@ -572,10 +576,10 @@ struct TaskGroupStatus {
|
572 | 576 | #if defined(_WIN32)
|
573 | 577 | #define STDERR_FILENO 2
|
574 | 578 | _write(STDERR_FILENO, message, strlen(message));
|
575 |
| -#else |
| 579 | +#elif defined(STDERR_FILENO) |
576 | 580 | write(STDERR_FILENO, message, strlen(message));
|
577 | 581 | #endif
|
578 |
| -#if defined(__APPLE__) |
| 582 | +#if defined(SWIFT_STDLIB_HAS_ASL) |
579 | 583 | asl_log(nullptr, nullptr, ASL_LEVEL_ERR, "%s", message);
|
580 | 584 | #elif defined(__ANDROID__)
|
581 | 585 | __android_log_print(ANDROID_LOG_FATAL, "SwiftRuntime", "%s", message);
|
@@ -1082,6 +1086,15 @@ static void _enqueueCompletedTask(NaiveTaskGroupQueue<ReadyQueueItem> *readyQueu
|
1082 | 1086 | readyQueue->enqueue(readyItem);
|
1083 | 1087 | }
|
1084 | 1088 |
|
| 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 | + |
1085 | 1098 | // TaskGroup is locked upon entry and exit
|
1086 | 1099 | void AccumulatingTaskGroup::enqueueCompletedTask(AsyncTask *completedTask, bool hadErrorResult) {
|
1087 | 1100 | // Retain the task while it is in the queue; it must remain alive until
|
|
0 commit comments