C++0x exceptions in threads?

  • Follow


In C++0x if an exception is thrown and not caught in some non-main
thread, what is defined to happen?

Thanks,
Brendan Miller

-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Reply Brendan 12/20/2008 1:41:05 PM

On 2008-12-20 08:41:05 -0500, Brendan <catphive@catphive.net> said:

> In C++0x if an exception is thrown and not caught in some non-main
> thread, what is defined to happen?
>

std::terminate().

-- 
  Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)



      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Reply Pete 12/21/2008 9:38:28 AM


On 20 Dec, 19:41, Brendan <catph...@catphive.net> wrote:

> In C++0x if an exception is thrown and not caught in some non-main
> thread, what is defined to happen?

I don't see that threads have anything to do with this - the document
I am looking at says:

[quote from N2798=08-0308]

9 If no matching handler is found, the function std::terminate() is
called; whether or not the stack is
unwound before this call to std::terminate() is implementation-defined
(15.5.1).

[end quote]

Neil Butterworth

-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Reply nbutterworth1953 12/21/2008 9:41:01 AM

On Dec 20, 2:41 pm, Brendan <catph...@catphive.net> wrote:
> In C++0x if an exception is thrown and not caught in some non-main
> thread, what is defined to happen?

std::terminate()

Reference [thread.thread.constr]/5 of CD1 (http://www.open-std.org/
jtc1/sc22/wg21/docs/papers/2008/n2800.pdf).

-Howard



-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Reply Howard 12/21/2008 9:44:36 AM

On Sun, 21 Dec 2008 01:11:05 +0530, Brendan <catphive@catphive.net> 
wrote:

> In C++0x if an exception is thrown and not caught in some non-main
> thread, what is defined to happen?

If no matching handler is found, the function std::terminate() is 
called.

Regards,
Jyoti

-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Reply Jyoti 12/21/2008 9:45:04 AM

4 Replies
88 Views

(page loaded in 0.133 seconds)

Similiar Articles:













7/15/2012 12:38:52 AM


Reply: