Timers: remove send bound on boxed timer callback#37983
Timers: remove send bound on boxed timer callback#37983gterzian wants to merge 3 commits intoservo:mainfrom
Conversation
…ndable callback for use in refresh driver Signed-off-by: gterzian <[email protected]>
6cddd81 to
c97eccf
Compare
… a cell Signed-off-by: gterzian <[email protected]>
c97eccf to
869e669
Compare
Signed-off-by: gterzian <[email protected]>
ebdce4d to
75bdaad
Compare
|
I'd like to look at this before it merges. I want to make sure the changes don't open a hole in our GC story for values captured in task closures. |
|
I don't believe this is safe right now.
|
mrobinson
left a comment
There was a problem hiding this comment.
No strong opinion on this, so if soundness issues are addressed it seems reasonable:
| scheduler.schedule_timer(request); | ||
| }, | ||
| let (callback, duration) = match message { | ||
| Ok(TimerThreadMessage::Request(cb, dur)) => (cb, dur), |
There was a problem hiding this comment.
Nit:
| Ok(TimerThreadMessage::Request(cb, dur)) => (cb, dur), | |
| Ok(TimerThreadMessage::Request(callback, duration)) => (callback, duration), |
Ok I see, so basically the current changes are in fact safe, because the cell is not a rooted type, but for example my suggestions at #37984 (using a Thanks for catching this. If we were to use the How about separating the queue of callbacks from the timer scheduler itself? For example:
EDIT: obviously one would use a hasmap, not a queue, since timers fire independently of their position in any queue. |
But introduce a new send-able callback for use in refresh driver.
This then enables switching to an cell for
has_pending_animation_tickin the script-thread, which uses no threading to schedule timers.Fix #37946