mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Threading] Create new threading library and use it.
Moved all the threading code to one place. Added explicit support for Darwin, Linux, Pthreads, C11 threads and Win32 threads, including new implementations of Once for Linux, Pthreads, C11 and Win32. rdar://90776105
This commit is contained in:
37
include/swift/Threading/Impl.h
Normal file
37
include/swift/Threading/Impl.h
Normal file
@@ -0,0 +1,37 @@
|
||||
//===--- Impl.h - Threading abstraction implementation -------- -*- C++ -*-===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
// Copyright (c) 2022 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Includes the relevant implementation file based on the selected threading
|
||||
// package.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef SWIFT_THREADING_IMPL_H
|
||||
#define SWIFT_THREADING_IMPL_H
|
||||
|
||||
#if SWIFT_THREADING_NONE
|
||||
#include "Impl/Nothreads.h"
|
||||
#elif SWIFT_THREADING_DARWIN
|
||||
#include "Impl/Darwin.h"
|
||||
#elif SWIFT_THREADING_LINUX
|
||||
#include "Impl/Linux.h"
|
||||
#elif SWIFT_THREADING_PTHREADS
|
||||
#include "Impl/Pthreads.h"
|
||||
#elif SWIFT_THREADING_C11
|
||||
#include "Impl/C11.h"
|
||||
#elif SWIFT_THREADING_WIN32
|
||||
#include "Impl/Win32.h"
|
||||
#else
|
||||
#error You need to implement Threading/Impl.h for your threading package.
|
||||
#endif
|
||||
|
||||
#endif // SWIFT_THREADING_IMPL_H
|
||||
Reference in New Issue
Block a user