diff options
Diffstat (limited to 'src/thread_pthread.cpp')
-rw-r--r-- | src/thread_pthread.cpp | 4 |
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 */ |