Skip to content

Commit

Permalink
Parallelism workaround for web build via Emscripten.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Dec 19, 2024
1 parent 2b01e92 commit aa4bb57
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/n8/ast/expression/ParallelExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include <thread>

DynamicObject ParallelExpression::visit(SymbolTable& symbols) {
#ifndef __EMSCRIPTEN__

std::thread task(
std::bind([
expr = std::move(this->expression),
Expand Down Expand Up @@ -137,5 +139,12 @@ DynamicObject ParallelExpression::visit(SymbolTable& symbols) {
);

symbols.addParallelism(std::move(task));

#else

this->expression->visit(symbols);

#endif

return {};
}

0 comments on commit aa4bb57

Please sign in to comment.