mirror of
https://github.com/swift-server/swift-service-lifecycle
synced 2026-11-24 04:38:12 +00:00
motivation: application frameworks thae use ServiceLifecycle may need to expose their underlying lifecycle so they can be also composed into larger systems changes: * expose ServiceLifecycle::underlying * make sure backtrace installer is only called once per process * add swift-atomics dependency (>=5.2 and above) * add atomic helper (<5.2)
24 lines
851 B
C
24 lines
851 B
C
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftServiceLifecycle open source project
|
|
//
|
|
// Copyright (c) 2021 Apple Inc. and the SwiftServiceLifecycle project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftServiceLifecycle project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
struct c_lifecycle_atomic_bool {
|
|
_Atomic bool value;
|
|
};
|
|
struct c_lifecycle_atomic_bool * _Nonnull c_lifecycle_atomic_bool_create(bool value);
|
|
|
|
bool c_lifecycle_atomic_bool_compare_and_exchange(struct c_lifecycle_atomic_bool * _Nonnull atomic, bool expected, bool desired);
|