summaryrefslogtreecommitdiffstats
path: root/libdimensionxx/progress.cpp
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-07-01 05:05:12 +0000
committerTavian Barnes <tavianator@gmail.com>2009-07-01 05:05:12 +0000
commit74a94dd492f9bcabf442e3f0c89dbb7cf8463cf8 (patch)
tree69d5d751bfaef3086e3c4a9702dc31f8cd20a1f2 /libdimensionxx/progress.cpp
parente19601e0f054211767c01a9d4812a480191f275b (diff)
downloaddimension-74a94dd492f9bcabf442e3f0c89dbb7cf8463cf8.tar.xz
Check for failure of worker thread in C++ dmnsn_progress* wrapper.
Diffstat (limited to 'libdimensionxx/progress.cpp')
-rw-r--r--libdimensionxx/progress.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/libdimensionxx/progress.cpp b/libdimensionxx/progress.cpp
index 0a32b72..66d9d7f 100644
--- a/libdimensionxx/progress.cpp
+++ b/libdimensionxx/progress.cpp
@@ -38,12 +38,11 @@ namespace Dimension
// Finish the progress if not yet finished and we are unique
Progress::~Progress()
{
- if (m_progress && m_progress.unique()) {
+ if (m_progress) {
try {
- dmnsn_finish_progress(dmnsn());
+ finish();
} catch (...) {
- dmnsn_error(SEVERITY_MEDIUM,
- "Finishing worker thread failed in Progress destructor.");
+ dmnsn_error(SEVERITY_MEDIUM, "Finishing worker thread failed.");
}
}
}
@@ -95,7 +94,10 @@ namespace Dimension
throw Dimension_Error("Attempt to finish non-unique Progress.");
}
- dmnsn_finish_progress(dmnsn());
+ if (dmnsn_finish_progress(dmnsn()) != 0) {
+ throw Dimension_Error("Worker thread failed.");
+ }
+
m_progress.reset(); // Don't try again
}