Skip to content

Commit ac0c3b7

Browse files
authored
[Concurrency] Freeze JobPriority, comment that Flags location is assumed (#64267)
1 parent 6f67905 commit ac0c3b7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/swift/ABI/Task.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ class alignas(2 * alignof(void*)) Job :
7272
// Reserved for the use of the scheduler.
7373
void *SchedulerPrivate[2];
7474

75+
/// WARNING: DO NOT MOVE.
76+
/// Schedulers may assume the memory location of the Flags in order to avoid a runtime call
77+
/// to get the priority of a job.
7578
JobFlags Flags;
7679

77-
// Derived classes can use this to store a Job Id.
80+
/// Derived classes can use this to store a Job Id.
7881
uint32_t Id = 0;
7982

8083
/// The voucher associated with the job. Note: this is currently unused on

stdlib/public/Concurrency/PartialAsyncTask.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public struct UnownedJob: Sendable {
6363
///
6464
/// Conversions between the two priorities are available as initializers on the respective types.
6565
@available(SwiftStdlib 5.9, *)
66+
@frozen
6667
public struct JobPriority {
6768
public typealias RawValue = UInt8
6869

0 commit comments

Comments
 (0)