Skip to content

Commit de1c3e6

Browse files
committed
Concurrency: report errors on failures on Windows
The usage of libdispatch in Concurrency is dynamic - it does not explicitly link against libdispatch and thus cannot directly invoke `dispatch_main`. While linking against dispatch would be ideal, this should improve the current path.
1 parent 349af37 commit de1c3e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/Concurrency/Task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,13 +1100,13 @@ static void swift_task_asyncMainDrainQueueImpl() {
11001100

11011101
HMODULE hModule = LoadLibraryW(L"dispatch.dll");
11021102
if (hModule == NULL)
1103-
abort();
1103+
swift_reportError(0, "unable to load dispatch.dll");
11041104

11051105
pfndispatch_main =
11061106
reinterpret_cast<void (FAR *)(void)>(GetProcAddress(hModule,
11071107
"dispatch_main"));
11081108
if (pfndispatch_main == NULL)
1109-
abort();
1109+
swift_reportError(0, "unable to locate dispatch_main in dispatch.dll");
11101110

11111111
pfndispatch_main();
11121112
exit(0);

0 commit comments

Comments
 (0)