Skip to content

Mark DispatchTimeInterval as Sendable #788

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 2 commits into from
Apr 25, 2023
Merged
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
6 changes: 3 additions & 3 deletions src/swift/Time.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import CDispatch

public struct DispatchTime : Comparable {
public struct DispatchTime : Comparable, Sendable {
#if HAVE_MACH
private static let timebaseInfo: mach_timebase_info_data_t = {
var info = mach_timebase_info_data_t(numer: 1, denom: 1)
Expand Down Expand Up @@ -96,7 +96,7 @@ extension DispatchTime {
}
}

public struct DispatchWallTime : Comparable {
public struct DispatchWallTime : Comparable, Sendable {
public let rawValue: dispatch_time_t

public static func now() -> DispatchWallTime {
Expand Down Expand Up @@ -165,7 +165,7 @@ private func toInt64Clamped(_ value: Double) -> Int64 {
/// let t1 = DispatchTimeInterval.seconds(Int.max)
/// let t2 = DispatchTimeInterval.milliseconds(Int.max)
/// let result = t1 == t2 // true
public enum DispatchTimeInterval: Equatable {
public enum DispatchTimeInterval: Equatable, Sendable {
case seconds(Int)
case milliseconds(Int)
case microseconds(Int)
Expand Down