mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Use spawn_named_with_send_on_failure for the RenderTask (fixes #2744).
This commit is contained in:
parent
4054a365b5
commit
d6798e4a39
1 changed files with 3 additions and 15 deletions
|
@ -19,9 +19,6 @@ use layers::platform::surface::{NativePaintingGraphicsContext, NativeSurface};
|
|||
use layers::platform::surface::{NativeSurfaceMethods};
|
||||
use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet};
|
||||
use layers;
|
||||
use native;
|
||||
use rustrt::task;
|
||||
use rustrt::task::TaskOpts;
|
||||
use servo_msg::compositor_msg::{Epoch, IdleRenderState, LayerId};
|
||||
use servo_msg::compositor_msg::{LayerMetadata, RenderListener, RenderingRenderState, ScrollPolicy};
|
||||
use servo_msg::constellation_msg::{ConstellationChan, Failure, FailureMsg, PipelineId};
|
||||
|
@ -30,6 +27,7 @@ use servo_msg::platform::surface::NativeSurfaceAzureMethods;
|
|||
use servo_util::geometry;
|
||||
use servo_util::opts::Opts;
|
||||
use servo_util::smallvec::{SmallVec, SmallVec1};
|
||||
use servo_util::task::spawn_named_with_send_on_failure;
|
||||
use servo_util::time::{TimeProfilerChan, profile};
|
||||
use servo_util::time;
|
||||
use std::comm::{Receiver, Sender, channel};
|
||||
|
@ -161,17 +159,7 @@ impl<C:RenderListener + Send> RenderTask<C> {
|
|||
let ConstellationChan(c) = constellation_chan.clone();
|
||||
let fc = font_cache_task.clone();
|
||||
|
||||
let mut task_opts = TaskOpts::new();
|
||||
task_opts.name = Some("RenderTask".into_maybe_owned());
|
||||
task_opts.on_exit = Some(proc(result: task::Result) {
|
||||
match result {
|
||||
Ok(()) => {},
|
||||
Err(..) => {
|
||||
c.send(FailureMsg(failure_msg));
|
||||
}
|
||||
}
|
||||
});
|
||||
native::task::spawn_opts(task_opts, proc() {
|
||||
spawn_named_with_send_on_failure("RenderTask", proc() {
|
||||
{ // Ensures RenderTask and graphics context are destroyed before shutdown msg
|
||||
let native_graphics_context = compositor.get_graphics_metadata().map(
|
||||
|md| NativePaintingGraphicsContext::from_metadata(&md));
|
||||
|
@ -213,7 +201,7 @@ impl<C:RenderListener + Send> RenderTask<C> {
|
|||
|
||||
debug!("render_task: shutdown_chan send");
|
||||
shutdown_chan.send(());
|
||||
});
|
||||
}, FailureMsg(failure_msg), c, true);
|
||||
}
|
||||
|
||||
fn start(&mut self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue