Oracle® Solaris Studio 12.4: C++ User's Guide

Exit Print View

Updated: March 2015
 
 

10.2 Using Exceptions in a Multithreaded Program

The current exception-handling implementation is safe for multithreading because exceptions in one thread do not interfere with exceptions in other threads. However, you cannot use exceptions to communicate across threads because an exception thrown from one thread cannot be caught in another.

Each thread can set its own terminate() or unexpected() function. Calling set_terminate() or set_unexpected() in one thread affects only the exceptions in that thread. The default function for terminate() is abort() for any thread (see Specifying Runtime Errors).