Skip to content

Commit 90662b6

Browse files
authored
Add missing type asserts when taking the queue out of the task struct (#57344)
This was causing some dynamic dispatches (caught by the juliac test)
1 parent 751a0d7 commit 90662b6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

base/experimental.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ function wait_with_timeout(c::GenericCondition; first::Bool=false, timeout::Real
658658
# Confirm that the waiting task is still in the wait queue and remove it. If
659659
# the task is not in the wait queue, it must have been notified already so we
660660
# don't do anything here.
661-
if !waiter_left[] && ct.queue == c.waitq
661+
if !waiter_left[] && ct.queue === c.waitq
662662
dosched = true
663663
Base.list_deletefirst!(c.waitq, ct)
664664
end

base/lock.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ function wait_no_relock(c::GenericCondition)
252252
try
253253
return wait()
254254
catch
255-
ct.queue === nothing || list_deletefirst!(ct.queue, ct)
255+
ct.queue === nothing || list_deletefirst!(ct.queue::IntrusiveLinkedList{Task}, ct)
256256
rethrow()
257257
end
258258
end

stdlib/REPL/test/repl.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function kill_timer(delay)
3232
# **DON'T COPY ME.**
3333
# The correct way to handle timeouts is to close the handle:
3434
# e.g. `close(stdout_read); close(stdin_write)`
35-
test_task.queue === nothing || Base.list_deletefirst!(test_task.queue, test_task)
35+
test_task.queue === nothing || Base.list_deletefirst!(test_task.queue::IntrusiveLinkedList{Task}, test_task)
3636
schedule(test_task, "hard kill repl test"; error=true)
3737
print(stderr, "WARNING: attempting hard kill of repl test after exceeding timeout\n")
3838
end

0 commit comments

Comments
 (0)