summaryrefslogtreecommitdiff
path: root/src/thread_pthread.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2009-01-12 14:31:49 +0000
committertruebrain <truebrain@openttd.org>2009-01-12 14:31:49 +0000
commit546d1b7580c729e8f87d8c1c2bd0e6ab5991948a (patch)
treeb155afce59b1ef1135c72989b46338bff871a0bd /src/thread_pthread.cpp
parent537a8b8342574f657e25398f6c11dd6ee06f31fd (diff)
downloadopenttd-546d1b7580c729e8f87d8c1c2bd0e6ab5991948a.tar.xz
(svn r15006) -Codechange: throw a real instance of a class, instead of '0' (which can also be a throw from within a thread for what ever reason)
Diffstat (limited to 'src/thread_pthread.cpp')
-rw-r--r--src/thread_pthread.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/thread_pthread.cpp b/src/thread_pthread.cpp
index b3f340b6a..2fbca79b2 100644
--- a/src/thread_pthread.cpp
+++ b/src/thread_pthread.cpp
@@ -92,7 +92,7 @@ public:
if (!IsRunning()) return false;
/* For now we terminate by throwing an error, gives much cleaner cleanup */
- throw 0;
+ throw OTTDThreadExitSignal();
}
/* virtual */ void Join()
@@ -137,7 +137,9 @@ private:
/* Call the proc of the creator to continue this thread */
try {
m_proc(m_param);
+ } catch (OTTDThreadExitSignal e) {
} catch (...) {
+ NOT_REACHED();
}
/* Notify threads waiting for our completion */