This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/28145] C++ (throw() and catch(...) {/* fall through */ } ) and pthread cancellation are incompatible (at least with NPTL)
- From: "hhinnant at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Nov 2006 23:33:20 -0000
- Subject: [Bug other/28145] C++ (throw() and catch(...) {/* fall through */ } ) and pthread cancellation are incompatible (at least with NPTL)
- References: <bug-28145-3264@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from hhinnant at apple dot com 2006-11-01 23:33 -------
So swallowing a cancel-exception (in C++) is sometimes the right thing to do.
Imagine a thread pool executing a queue of tasks. These tasks can well have
handles so that clients can wait/join with results in the future. Such results
could be normal or exceptional. If you've got a hung task in a thread pool,
maybe you want to cancel it. That means the task should end, but once the OS
thread dumps the task, records the exception that ended it (cancellation), the
thread should be free to get the next task out of the queue and execute it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28145