mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SWIFT_STDLIB_SINGLE_THREADED_RUNTIME is too much of a blunt instrument here. It covers both the Concurrency runtime and the rest of the runtime, but we'd like to be able to have e.g. a single-threaded Concurrency runtime while the rest of the runtime is still thread safe (for instance). So: rename it to SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY and make it just control the Concurrency runtime, then add a SWIFT_STDLIB_THREADING_PACKAGE setting at the CMake/build-script level, which defines SWIFT_STDLIB_THREADING_xxx where xxx depends on the chosen threading package. This is especially useful on systems where there may be a choice of threading package that you could use. rdar://90776105
26 lines
905 B
C++
26 lines
905 B
C++
//===--- Mutex.cpp - Mutex 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 "Error.h"
|
|
|
|
#define SWIFT_FATAL_ERROR swift_Concurrency_fatalError
|
|
|
|
// Include the runtime's mutex support code.
|
|
// FIXME: figure out some reasonable way to share this stuff
|
|
|
|
#include "../runtime/MutexPThread.cpp"
|
|
#include "../runtime/MutexWin32.cpp"
|
|
#include "../runtime/MutexC11.cpp"
|
|
#ifdef SWIFT_STDLIB_THREADING_NONE
|
|
#include "swift/Runtime/MutexSingleThreaded.h"
|
|
#endif
|