summaryrefslogtreecommitdiff
path: root/src/thread_morphos.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
commit53ca48efe202a10404351b51006b503c41fbe7f5 (patch)
treeb155afce59b1ef1135c72989b46338bff871a0bd /src/thread_morphos.cpp
parent7947e78daaa22045d0d93b98d296ef65b58753d0 (diff)
downloadopenttd-53ca48efe202a10404351b51006b503c41fbe7f5.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_morphos.cpp')
-rw-r--r--src/thread_morphos.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/thread_morphos.cpp b/src/thread_morphos.cpp
index ef074da45..fcf459d04 100644
--- a/src/thread_morphos.cpp
+++ b/src/thread_morphos.cpp
@@ -153,7 +153,7 @@ public:
if (NewGetTaskAttrs(NULL, &msg, sizeof(struct OTTDThreadStartupMessage *), TASKINFOTYPE_STARTUPMSG, TAG_DONE) && msg != NULL) {
/* For now we terminate by throwing an error, gives much cleaner cleanup */
- throw 0;
+ throw OTTDThreadExitSignal();
}
return true;
@@ -203,8 +203,10 @@ private:
if (NewGetTaskAttrs(NULL, &msg, sizeof(struct OTTDThreadStartupMessage *), TASKINFOTYPE_STARTUPMSG, TAG_DONE) && msg != NULL) {
try {
msg->func(msg->arg);
- } catch(...) {
+ } catch(OTTDThreadExitSignal e) {
KPutStr("[Child] Returned to main()\n");
+ } catch(...) {
+ NOT_REACHED();
}
}