diff --git a/Makefile b/Makefile index 86a3042..3186083 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ all: kmc kmc_dump kmc_tools py_kmc_api +dummy := $(shell git submodule update --init --recursive) + UNAME_S := $(shell uname -s) UNAME_M := $(shell uname -m) UNAME_P := $(shell uname -p) diff --git a/kmc_core/kmc.h b/kmc_core/kmc.h index 4c228aa..f5e1025 100644 --- a/kmc_core/kmc.h +++ b/kmc_core/kmc.h @@ -1802,14 +1802,26 @@ template KMC::Stage2Results CKMC::ProcessStage2_impl() template KMC::Stage1Results CKMC::ProcessStage1() { - auto res = ProcessStage1_impl(); + KMC::Stage1Results res; + //run on separate exception aware thread for proper exception handling + CExceptionAwareThread th([&res, this] { + res = this->ProcessStage1_impl(); + }); + th.join(); + CThreadExceptionCollector::Inst().RethrowIfAnyException(); return res; } template KMC::Stage2Results CKMC::ProcessStage2() { - auto res = ProcessStage2_impl(); + KMC::Stage2Results res; + //run on separate exception aware thread for proper exception handling if exception thrown in main thread + CExceptionAwareThread th([&res, this] { + res = this->ProcessStage2_impl(); + }); + th.join(); + CThreadExceptionCollector::Inst().RethrowIfAnyException(); return res; }