]> https://gitweb.dealii.org/ - dealii.git/commitdiff
More gracefully handle the case that an exception is thrown on a task created by...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 2 Jun 2013 18:13:30 +0000 (18:13 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 2 Jun 2013 18:13:30 +0000 (18:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@29727 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/base/thread_management.h

index 481f12e462912d4c1344d3066cb12a6bcf86b40c..fa981c6d967f5f192027aed938a8f1d7693ef07c 100644 (file)
@@ -130,8 +130,15 @@ this function.
 <h3>Specific improvements</h3>
 
 <ol>
+<li> Fixed: If an exception was generated on a task created by
+Threads::new_task, the program would terminate with a segmentation
+fault, leaving little trace of what had happened. This is now handled
+more gracefully.
+<br>
+(Wolfgang Bangerth, 2013/06/02)
+</li>
 
-<li> Changed: subdomainids can now only be queried/set on active cells.
+<li> Changed: subdomain ids can now only be queried/set on active cells.
 Consequently, is_artificial(), is_ghost(), and is_locally_owned() is
 now restricted to active cells.
 <br>
index 316ba303b32a9893951a6a6527e4bb235e6bc2ec..099f03927b7e4b7dbf14aa2715226f907ba62b34 100644 (file)
@@ -4059,7 +4059,18 @@ namespace Threads
         // call the function object
         // and put the return value
         // into the proper place
-        call (task_descriptor.function, task_descriptor.ret_val);
+        try
+          {
+            call (task_descriptor.function, task_descriptor.ret_val);
+          }
+        catch (const std::exception &exc)
+          {
+            internal::handle_std_exception (exc);
+          }
+        catch (...)
+          {
+            internal::handle_unknown_exception ();
+          }
         return 0;
       }
 
@@ -4234,7 +4245,7 @@ namespace Threads
       // the TBB book on pages
       // 230/231 ("Start a large task
       // in parallel with the main
-      // program)
+      // program")
       task = new (tbb::task::allocate_root()) tbb::empty_task;
       task->set_ref_count (2);
 
@@ -4349,6 +4360,7 @@ namespace Threads
       {
         call (function, ret_val);
       }
+
       /**
        * Wait for the task to
        * return. Since we are in

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.