From d8d66db77005c58d406d66cdc6d8cf096109f187 Mon Sep 17 00:00:00 2001 From: Owen Green Date: Mon, 5 Aug 2019 17:29:45 +0100 Subject: [PATCH] Hit SC Wrapper until threading works (mostly making sure it only tries to run async post-job functions once): TODO Fix up for stateful clients (not yet an issue) --- include/FluidSCWrapper.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index e23494d..62510cd 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -195,8 +195,10 @@ public: out0(0) = static_cast(mClient.progress()); } else { - mDone = true; +// if(mClient.state() == kDone) +// mDone = true; mCalcFunc = mWorld->ft->fClearUnitOutputs; +// if(!mDone) mWorld->ft->fDoAsynchronousCommand(mWorld, nullptr, Wrapper::getName(), this, postProcess, exchangeBuffers, tidyUp, destroy, 0, nullptr); @@ -214,7 +216,7 @@ public: if (!result.ok()) { std::cout << "ERROR: " << Wrapper::getName() << ": " << result.message().c_str() << std::endl; - w->mDone = true; +// w->mDone = true; return; } @@ -238,6 +240,9 @@ public: std::cout << "ERROR: " << Wrapper::getName() << ": " << r.message().c_str() << '\n'; return false; } + +// w->mDone = true; + return true; } @@ -250,8 +255,11 @@ public: static void destroy(World *world, void *data) { auto w = static_cast(data); - int doneAction = static_cast(w->in0(static_cast(w->mNumInputs - 1))); - world->ft->fDoneAction(doneAction,w); +// if(w->mDone) +// { + int doneAction = static_cast(w->in0(static_cast(w->mNumInputs - 1))); + world->ft->fDoneAction(doneAction,w); +// } } static void doCancel(Unit *unit, sc_msg_iter*)