(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)

This commit is contained in:
truebrain
2009-01-12 14:31:49 +00:00
parent 537a8b8342
commit 546d1b7580
4 changed files with 12 additions and 4 deletions

View File

@@ -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();
}
}