Skip to content
Snippets Groups Projects
Commit c37d7083 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Use timeout exceptions

parent 70b65674
No related branches found
No related tags found
1 merge request!358Updates to SDK and alternative fusion
Pipeline #33804 passed
......@@ -42,10 +42,12 @@ void PipelineImpl::submit(const voltu::FramePtr &frame)
}
}
bool PipelineImpl::waitCompletion(int timeout)
bool PipelineImpl::waitCompletion(int timeout, bool except)
{
int count = timeout / 5;
while (!ready_ && --count >= 0) std::this_thread::sleep_for(std::chrono::milliseconds(5));
if (!ready_) throw voltu::exceptions::Timeout();
return ready_;
}
......
......@@ -16,7 +16,7 @@ public:
void submit(const voltu::FramePtr &frame) override;
bool waitCompletion(int timeout) override;
bool waitCompletion(int timeout, bool except) override;
voltu::OperatorPtr appendOperator(voltu::OperatorId id) override;
......
......@@ -64,7 +64,7 @@ public:
* @param timeout Millisecond timeout, or 0 for non-blocking check.
* @return True if completed
*/
PY_API virtual bool waitCompletion(int timeout) = 0;
PY_API virtual bool waitCompletion(int timeout, bool except=false) = 0;
/**
* @brief Add an operator to this pipeline.
......
......@@ -8,7 +8,7 @@
// Bump these for each release
#define VOLTU_VERSION_MAJOR 0 // For API incompatible changes
#define VOLTU_VERSION_MINOR 3 // For binary compatibility and extensions
#define VOLTU_VERSION_MINOR 4 // For binary compatibility and extensions
#define VOLTU_VERSION_PATCH 0 // Binary compatible internal fixes
#define VOLTU_VERSION ((VOLTU_VERSION_MAJOR*10000) + (VOLTU_VERSION_MINOR*100) + VOLTU_VERSION_PATCH)
......
......@@ -91,7 +91,7 @@ int main(int argc, char **argv)
for (int i=0; i<frameno; ++i)
{
room->waitNextFrame(5000);
room->waitNextFrame(5000, true);
room->getFrame();
}
auto frame = room->getFrame();
......@@ -108,7 +108,7 @@ int main(int argc, char **argv)
op1->property("mls_iterations")->setInt(iters);
pipe->submit(frame);
pipe->waitCompletion(3000);
pipe->waitCompletion(3000, true);
auto imgset = frame->getImageSet(display_channel);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment