Opened 17 years ago

Closed 16 years ago

#486 closed Bugs (None)

Exception safety in class \"thread\"

Reported by: nobody Owned by: Roland Schwarz
Milestone: Component: threads
Version: None Severity:
Keywords: Cc:

Description

If an exception is thrown during the copying of the
"threadfunc" object in function "thread_proxy", the new
thread silently ends and the constructor of class
"thread" never returns.

Therefore I would suggest to put a copy of "threadfunc"
in the "thread_param" object (instead of a reference)
and move it to the local variable in function
"thread_proxy" via "threadfunc.swap(…)".

In this way a potential exception would be thrown in
the constructor of class "thread" and could be handled
by the application.

Change History (2)

comment:1 by mclow, 17 years ago

Summary: Exception safety in class "thread"Exception safety in class \"thread\"

comment:2 by Roland Schwarz, 16 years ago

Status: assignedclosed
Logged In: YES 
user_id=541730

The thread_proxy no longer silently dies on exceptions.
Note: See TracTickets for help on using tickets.