]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Put back in the code that (de-)registers threads and catches exceptions.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Jan 2009 15:23:40 +0000 (15:23 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Jan 2009 15:23:40 +0000 (15:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@18262 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/thread_management.h

index a2d7efa69fbda1103ab9966f27a027d01df289eb..bf56e0a51e357bd1b1b66bdc7226f48b04a671a7 100644 (file)
@@ -1260,7 +1260,32 @@ namespace Threads
        void thread_entry_point (const std_cxx0x::function<RT ()> function,
                                 return_value<RT> *ret_val)
          {
-           call (function, *ret_val);
+                                            // now call the function
+                                            // in question. since an
+                                             // exception that is
+                                             // thrown from one of the
+                                             // called functions will
+                                             // not propagate to the
+                                             // main thread, it will
+                                             // kill the program if
+                                             // not treated here
+                                             // before we return to
+                                             // the operating system's
+                                             // thread library
+            internal::register_thread ();
+            try 
+              {
+                call (function, *ret_val);
+              }
+            catch (const std::exception &exc)
+              {
+                internal::handle_std_exception (exc);
+              }
+            catch (...)
+              {
+                internal::handle_unknown_exception ();
+              }
+            internal::deregister_thread ();
          }
     };
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.