@@ -291,23 +291,23 @@ extension Task: Equatable {
291291}
292292
293293// ==== -----------------------------------------------------------------------
294- // MARK: Task Identifier
294+ // MARK: Task ID
295295
296296/// An opaque, process-unique identifier for a Swift ``Task``.
297297///
298- /// A `TaskIdentifier ` is assigned at task creation, never changes for the
299- /// lifetime of the task, and is never reused once a task has completed.
300- /// Identifiers are scoped to the current process and are not suitable for
301- /// cross-process correlation.
298+ /// A `TaskID ` is assigned at task creation, never changes for the lifetime
299+ /// of the task, and is never reused once a task has completed. IDs are
300+ /// scoped to the current process and are not suitable for cross-process
301+ /// correlation.
302302///
303- /// Reading the identifier of the currently-executing task is fast.
303+ /// Reading the ID of the currently-executing task is fast.
304304///
305- /// - See: ``Task/currentIdentifier ``
306- /// - See: ``Task/identifier ``
307- /// - See: ``UnsafeCurrentTask/identifier ``
305+ /// - See: ``Task/currentID ``
306+ /// - See: ``Task/id ``
307+ /// - See: ``UnsafeCurrentTask/id ``
308308@available ( StdlibDeploymentTarget 6 . 5 , * )
309309@frozen
310- public struct TaskIdentifier : Sendable , Hashable {
310+ public struct TaskID : Sendable , Hashable {
311311 @usableFromInline
312312 internal var _rawValue : UInt64
313313
@@ -316,21 +316,21 @@ public struct TaskIdentifier: Sendable, Hashable {
316316 self . _rawValue = _rawValue
317317 }
318318
319- /// The raw 64-bit value of this identifier .
319+ /// The raw 64-bit value of this ID .
320320 ///
321321 /// This is the only escape hatch from the opaque type and is intended for
322322 /// serialization, logging, or interop with tools that expect a numeric
323323 /// task ID. The numeric value carries no semantic meaning beyond the
324- /// guarantees on `TaskIdentifier ` itself.
324+ /// guarantees on `TaskID ` itself.
325325 @_alwaysEmitIntoClient
326326 public var rawValue : UInt64 { _rawValue }
327327}
328328
329329@available ( StdlibDeploymentTarget 6 . 5 , * )
330330extension Task {
331- /// A type alias for ``TaskIdentifier ``, providing the spelling
332- /// `Task.Identifier ` at the use site.
333- public typealias Identifier = TaskIdentifier
331+ /// A type alias for ``TaskID ``, providing the spelling
332+ /// `Task.ID ` at the use site.
333+ public typealias ID = TaskID
334334}
335335
336336// ==== Task Priority ----------------------------------------------------------
@@ -482,27 +482,27 @@ extension Task where Success == Never, Failure == Never {
482482 }
483483 }
484484
485- /// The stable identifier of the currently-executing task.
485+ /// The stable ID of the currently-executing task.
486486 ///
487487 /// If you access this static property outside the execution context of a
488488 /// task, it will return `nil`.
489489 ///
490- /// This identifier is quick to obtain and can be used to reliably identify
491- /// a task, instead of its memory address which may be reused once the task
490+ /// This ID is quick to obtain and can be used to reliably identify a
491+ /// task, instead of its memory address which may be reused once the task
492492 /// has been destroyed. No guarantees are made about its exact numeric
493493 /// value.
494494 ///
495- /// - SeeAlso: ``Task/identifier ``
496- /// - SeeAlso: ``UnsafeCurrentTask/identifier ``
495+ /// - SeeAlso: ``Task/id ``
496+ /// - SeeAlso: ``UnsafeCurrentTask/id ``
497497 @available ( StdlibDeploymentTarget 6 . 5 , * )
498498 @_alwaysEmitIntoClient
499- public static var currentIdentifier : Task . Identifier ? {
499+ public static var currentID : Task . ID ? {
500500 // Direct runtime call: reads the id on the current AsyncTask without
501501 // ever surfacing the task reference to Swift, so there's no ARC dance.
502502 // The runtime returns 0 when there is no current task; task IDs are
503503 // guaranteed to be non-zero.
504504 let id = _getCurrentTaskId ( )
505- return id == 0 ? nil : TaskIdentifier ( _rawValue: id)
505+ return id == 0 ? nil : TaskID ( _rawValue: id)
506506 }
507507
508508}
@@ -710,22 +710,22 @@ extension Task {
710710 }
711711 }
712712
713- /// A stable identifier for this task.
713+ /// A stable ID for this task.
714714 ///
715- /// This identifier is quick to obtain and can be used to reliably identify
716- /// a task, instead of its memory address which may be reused once the task
715+ /// This ID is quick to obtain and can be used to reliably identify a
716+ /// task, instead of its memory address which may be reused once the task
717717 /// has been destroyed. No guarantees are made about its exact numeric
718718 /// value.
719719 ///
720- /// The same identifier is visible in tools such as `swift-inspect` and
720+ /// The same ID is visible in tools such as `swift-inspect` and
721721 /// Instruments, which makes it a convenient correlation key for tracing
722722 /// and logging.
723723 ///
724- /// - SeeAlso: ``Task/currentIdentifier ``
725- /// - SeeAlso: ``UnsafeCurrentTask/identifier ``
724+ /// - SeeAlso: ``Task/currentID ``
725+ /// - SeeAlso: ``UnsafeCurrentTask/id ``
726726 @available ( StdlibDeploymentTarget 6 . 5 , * )
727727 @_alwaysEmitIntoClient
728- public var identifier : Identifier {
728+ public var id : ID {
729729 unsafe . init (
730730 _rawValue: _getJobTaskId ( unsafeBitCast ( _task, to: UnownedJob . self) ) )
731731 }
@@ -987,21 +987,21 @@ public struct UnsafeCurrentTask {
987987 }
988988 }
989989
990- /// A stable identifier for the current task.
990+ /// A stable ID for the current task.
991991 ///
992- /// This identifier is quick to obtain and can be used to reliably identify
993- /// a task, instead of its memory address which may be reused once the task
992+ /// This ID is quick to obtain and can be used to reliably identify a
993+ /// task, instead of its memory address which may be reused once the task
994994 /// has been destroyed. No guarantees are made about its exact numeric
995995 /// value.
996996 ///
997- /// Returns the same value as ``Task/identifier `` read on the owning task.
997+ /// Returns the same value as ``Task/id `` read on the owning task.
998998 ///
999- /// - SeeAlso: ``Task/identifier ``
1000- /// - SeeAlso: ``Task/currentIdentifier ``
999+ /// - SeeAlso: ``Task/id ``
1000+ /// - SeeAlso: ``Task/currentID ``
10011001 @available ( StdlibDeploymentTarget 6 . 5 , * )
10021002 @_alwaysEmitIntoClient
1003- public var identifier : Task . Identifier {
1004- unsafe TaskIdent ifier (
1003+ public var id : Task . ID {
1004+ unsafe TaskID (
10051005 _rawValue: _getJobTaskId ( unsafeBitCast ( _task, to: UnownedJob . self) ) )
10061006 }
10071007}
0 commit comments