From 53ca48efe202a10404351b51006b503c41fbe7f5 Mon Sep 17 00:00:00 2001 From: truebrain Date: Mon, 12 Jan 2009 14:31:49 +0000 Subject: (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) --- src/thread_pthread.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/thread_pthread.cpp') 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 */ -- cgit v1.2.3-54-g00ecf