Skip to content

SwiftPrivateThreadExtras: clean up using WinSDK SDK overlay #20940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ add_swift_target_library(swiftSwiftPrivateThreadExtras ${SWIFT_STDLIB_LIBRARY_BU
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
SWIFT_MODULE_DEPENDS_HAIKU Glibc
SWIFT_MODULE_DEPENDS_WINDOWS MSVCRT
SWIFT_MODULE_DEPENDS_WINDOWS MSVCRT WinSDK
SWIFT_COMPILE_FLAGS
INSTALL_IN_COMPONENT stdlib-experimental)

Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ public func _stdlib_thread_join<Result>(
_ resultType: Result.Type
) -> (CInt, Result?) {
#if os(Windows)
// TODO(compnerd) modularize rpc.h for INFINITE (0xffffffff)
let result = WaitForSingleObject(thread, 0xffffffff);
// TODO(compnerd) modularize WinBase.h for WAIT_OBJECT_0 (0)
if result == 0 {
let result = WaitForSingleObject(thread, INFINITE)
if result == WAIT_OBJECT_0 {
var threadResult: DWORD = 0
GetExitCodeThread(thread, &threadResult)
CloseHandle(thread)
Expand Down
3 changes: 1 addition & 2 deletions stdlib/private/SwiftPrivateThreadExtras/ThreadBarriers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ public func _stdlib_thread_barrier_wait(
if barrier.pointee.numThreadsWaiting < barrier.pointee.count {
// Put the thread to sleep.
#if os(Windows)
// TODO(compnerd) modularize rpc.h to get INFIITE (0xffffffff)
if SleepConditionVariableSRW(barrier.pointee.cond!, barrier.pointee.mutex!,
0xffffffff, 0) == 0 {
INFINITE, 0) == 0 {
return -1
}
ReleaseSRWLockExclusive(barrier.pointee.mutex!)
Expand Down