Skip to content

Commit

Permalink
Merge pull request #698 from leapmotion/ref-parallelexcept
Browse files Browse the repository at this point in the history
Throw exceptions if the context isn't running during a call to begin()
  • Loading branch information
jdonald committed Jul 31, 2015
2 parents ef385af + 6650b10 commit e9b1389
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions autowiring/Parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ class parallel {
// Get an iterator to the begining of out queue of job results
template<typename T>
parallel_iterator<T> begin(void) {
if (!m_ctxt->IsRunning())
if (m_ctxt->IsShutdown())
throw std::runtime_error("Attempted to enumerate members of a context after the context was shut down");
else
throw std::runtime_error("Start the context before attempting to enumerate members of an autowiring::parallel collection");
return{ *this, m_outstandingCount };
}

Expand Down

0 comments on commit e9b1389

Please sign in to comment.