Skip to content

Commit ef34c05

Browse files
committed
Disable try/catch in executor if TF_DISABLE_EXCEPTION_HANDLING defined
1 parent ec5c527 commit ef34c05

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

taskflow/core/executor.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,9 @@ inline void Executor::_spawn(size_t N) {
12451245
// must use 1 as condition instead of !done because
12461246
// the previous worker may stop while the following workers
12471247
// are still preparing for entering the scheduling loop
1248+
#ifndef TF_DISABLE_EXCEPTION_HANDLING
12481249
try {
1250+
#endif
12491251

12501252
// worker loop
12511253
while(1) {
@@ -1258,10 +1260,13 @@ inline void Executor::_spawn(size_t N) {
12581260
break;
12591261
}
12601262
}
1263+
1264+
#ifndef TF_DISABLE_EXCEPTION_HANDLING
12611265
}
12621266
catch(...) {
12631267
ptr = std::current_exception();
12641268
}
1269+
#endif
12651270

12661271
// call the user-specified epilogue function
12671272
if(_worker_interface) {

0 commit comments

Comments
 (0)