[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:
Alastair Houghton
2022-04-15 13:50:33 +01:00
parent 66b9d21000
commit f5bdb858e0
98 changed files with 2286 additions and 1410 deletions

View File

@@ -327,8 +327,8 @@ function(_add_target_variant_swift_compile_flags
list(APPEND result "-D" "SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY")
endif()
threading_package_name(_threading_package)
list(APPEND result "-D" "SWIFT_STDLIB_THREADING_${_threading_package}")
threading_package_name("${sdk}" _threading_package)
list(APPEND result "-D" "SWIFT_THREADING_${_threading_package}")
set("${result_var_name}" "${result}" PARENT_SCOPE)
endfunction()
@@ -483,7 +483,7 @@ function(_compile_swift_files
list(APPEND swift_flags "-Xfrontend" "-library-level" "-Xfrontend" "api")
endif()
if(SWIFT_STDLIB_THREADING_PACKAGE STREQUAL "none")
if(SWIFT_THREADING_PACKAGE STREQUAL "none")
list(APPEND swift_flags "-Xfrontend" "-assume-single-threaded")
endif()