Release lock while rendering.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7f28a321e3
commit
8f73d5a25a
@ -263,17 +263,20 @@ fn render_worker(
|
|||||||
output_chan: &SyncSender<Response>,
|
output_chan: &SyncSender<Response>,
|
||||||
) {
|
) {
|
||||||
loop {
|
loop {
|
||||||
match input_chan.lock().unwrap().recv() {
|
let job = { input_chan.lock().unwrap().recv() };
|
||||||
|
match job {
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
info!("Shutting down render_worker {}: {}", tid, err);
|
info!("Shutting down render_worker {}: {}", tid, err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Ok(req) => match req {
|
Ok(req) => match req {
|
||||||
Request::Line { width, y } => {
|
Request::Line { width, y } => {
|
||||||
|
trace!("tid {} width {} y {}", tid, width, y);
|
||||||
let pixels = (0..width).map(|x| render_pixel(scene, x, y)).collect();
|
let pixels = (0..width).map(|x| render_pixel(scene, x, y)).collect();
|
||||||
output_chan.send(Response::Line { width, y, pixels });
|
output_chan.send(Response::Line { width, y, pixels });
|
||||||
}
|
}
|
||||||
Request::Pixel { x, y } => {
|
Request::Pixel { x, y } => {
|
||||||
|
trace!("tid {} x {} y {}", tid, x, y);
|
||||||
let pixel = render_pixel(scene, x, y);
|
let pixel = render_pixel(scene, x, y);
|
||||||
output_chan.send(Response::Pixel { x, y, pixel });
|
output_chan.send(Response::Pixel { x, y, pixel });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user