Skip to content

[Threading][Runtime] Separate threading error function to fix link on Linux. #59457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stdlib/public/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ set(swift_runtime_sources
RuntimeInvocationsTracking.cpp
SwiftDtoa.cpp
SwiftTLSContext.cpp
ThreadingError.cpp
AccessibleFunction.cpp)

# Acknowledge that the following sources are known.
Expand Down
10 changes: 0 additions & 10 deletions stdlib/public/runtime/Errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,3 @@ void swift::swift_abortDisabledUnicodeSupport() {
"Unicode normalization data is disabled on this platform");

}

/// Halt because of a problem in the threading library
SWIFT_ATTRIBUTE_NORETURN
SWIFT_FORMAT(1, 2)
void swift::threading::fatal(const char *msg, ...) {
va_list val;
va_start(val, msg);

swift::fatalErrorv(0, msg, val);
}
25 changes: 25 additions & 0 deletions stdlib/public/runtime/ThreadingError.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//===--- ThreadingError.cpp - Error handling support code -----------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

#include "swift/Runtime/Debug.h"
#include "swift/Threading/Errors.h"
#include <cstdio>

// Handle fatal errors from the threading library
SWIFT_ATTRIBUTE_NORETURN
SWIFT_FORMAT(1, 2)
void swift::threading::fatal(const char *format, ...) {
va_list val;

va_start(val, format);
swift::fatalErrorv(0, format, val);
}