From 9070f7d48e4c4b100ae414a047cebb7fecf9bcdf Mon Sep 17 00:00:00 2001 From: Trivernis Date: Wed, 13 Jan 2021 11:16:59 +0100 Subject: [PATCH] Add controlled panic on send error Signed-off-by: Trivernis --- Cargo.toml | 2 +- src/executor/mod.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 22b3a66..eb45628 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ description = "OpenCL Stream execution framework" repository = "https://github.com/parallel-programming-hwr/ocl-stream-rs" license = "Apache-2.0" readme = "README.md" -version = "0.3.1" +version = "0.3.2" authors = ["Trivernis "] edition = "2018" diff --git a/src/executor/mod.rs b/src/executor/mod.rs index 4a9bc31..a4e24e1 100644 --- a/src/executor/mod.rs +++ b/src/executor/mod.rs @@ -96,7 +96,9 @@ impl OCLStreamExecutor { let sender = context.sender().clone(); if let Err(e) = func(context) { - sender.err(e).unwrap(); + if let Err(e) = sender.err(e) { + panic!("Failed to forward error to receiver: {}", e); + } } }) .expect("Failed to spawn ocl thread");