Opened 8 years ago

Last modified 8 years ago

#10966 assigned Feature Requests

packaged_task::reset should not reuse the shared state to conform to C++11

Reported by: viboes Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

The standard says

void reset();
Effects: as if *this = packaged_task(std::move(f)), where f is the task stored in *this. [ Note: This constructs a new shared state for *this. The old state is abandoned (30.6.4). — end note ]
Throws:
— bad_alloc if memory for the new shared state could not be allocated.
— any exception thrown by the move constructor of the task stored in the shared state. 
— future_error with an error condition of no_state if *this has no shared state.

Boost.Thread reuse the shared state.

Effects: Reset the state of the packaged_task so that it can be called again. 

Change History (1)

comment:1 by viboes, 8 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned
Note: See TracTickets for help on using tickets.