mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #85278 from al45tair/add-fatal-error-6.2.1
[Observation] Add threading fatal error handler.
This commit is contained in:
@@ -19,6 +19,7 @@ add_swift_target_library(swiftObservation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS
|
|||||||
ObservationRegistrar.swift
|
ObservationRegistrar.swift
|
||||||
ObservationTracking.swift
|
ObservationTracking.swift
|
||||||
Observations.swift
|
Observations.swift
|
||||||
|
ThreadingError.cpp
|
||||||
ThreadLocal.cpp
|
ThreadLocal.cpp
|
||||||
ThreadLocal.swift
|
ThreadLocal.swift
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
//===--- ThreadingError.cpp - Error handling support code -----------------===//
|
||||||
|
//
|
||||||
|
// This source file is part of the Swift.org open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2014 - 2025 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/Threading/Errors.h"
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
vfprintf(stderr, format, val);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user