mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Force all messages to worker tasks to send a TrustedWorkerAddress along with the ScriptMsg. This ensures that the main-thread Worker object is rooted for as long as there are events in flight or being processed.
This commit is contained in:
parent
2f059c15e7
commit
9a7cd31134
11 changed files with 234 additions and 121 deletions
|
@ -100,7 +100,7 @@ impl TimerManager {
|
|||
timeout: i32,
|
||||
is_interval: IsInterval,
|
||||
source: TimerSource,
|
||||
script_chan: ScriptChan)
|
||||
script_chan: Box<ScriptChan+Send>)
|
||||
-> i32 {
|
||||
let timeout = cmp::max(0, timeout) as u64;
|
||||
let handle = self.next_timer_handle.get();
|
||||
|
@ -136,8 +136,7 @@ impl TimerManager {
|
|||
let id = select.wait();
|
||||
if id == timeout_handle.id() {
|
||||
timeout_port.recv();
|
||||
let ScriptChan(ref chan) = script_chan;
|
||||
chan.send(ScriptMsg::FireTimer(source, TimerId(handle)));
|
||||
script_chan.send(ScriptMsg::FireTimer(source, TimerId(handle)));
|
||||
if is_interval == IsInterval::NonInterval {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue