Skip to content

Commit 1cac3ee

Browse files
committed
Fix bit manipulation in ActiveTaskStatus::withEscalatedPriority().
Due to a missing `~` when trying to mask in a new priority + the `IsEscalated` flag, we were instead getting an incorrect priority as well as dropping other useful bits. This led to assertions about the running state of a task not being set.
1 parent 66f3fca commit 1cac3ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/Concurrency/TaskPrivate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class alignas(sizeof(void*) * 2) ActiveTaskStatus {
210210
ActiveTaskStatus withEscalatedPriority(JobPriority priority) const {
211211
assert(priority > getStoredPriority());
212212
return ActiveTaskStatus(Record,
213-
(Flags & PriorityMask)
213+
(Flags & ~PriorityMask)
214214
| IsEscalated | uintptr_t(priority));
215215
}
216216
ActiveTaskStatus withoutStoredPriorityEscalation() const {

0 commit comments

Comments
 (0)