Title
Ensure that future's get() blocks when not ready
Status
resolved
Section
[futures.unique.future]
Submitter
Alisdair Meredith

Created on 2009-03-12.00:00:00 last changed 169 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Add a paragraph to [futures.unique_future]:

R&& unique_future::get();
R& unique_future<R&>::get();
void unique_future<void>::get();

Note:...

Effects: If is_ready() would return false, block on the asynchronous result associated with *this.

Synchronization: if *this is associated with a promise object, the completion of set_value() or set_exception() to that promise happens before (1.10) get() returns.

Date: 2010-12-05.14:14:49

[ 2009-10 Santa Cruz: ]

NAD EditorialResolved. Addressed by N2997.

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

It is not clear to us that this is an issue, because the proposed resolution's Effects clause seems to duplicate information already present in the Synchronization clause. Keep in Review status.

Date: 2009-04-03.00:00:00

[ 2009-04-03 Thomas J. Gritzan adds: ]

This issue also applies to shared_future::get().

Suggested wording:

Add a paragraph to [futures.shared_future]:

void shared_future<void>::get() const;

Effects: If is_ready() would return false, block on the asynchronous result associated with *this.

Date: 2010-10-21.18:28:33

[ Summit: ]

Agree, move to Review.

Date: 2012-10-21.13:19:07

Addresses UK 334 [CD1]

Behaviour of get() is undefined if calling get() while not is_ready(). The intent is that get() is a blocking call, and will wait for the future to become ready.

History
Date User Action Args
2010-12-05 14:14:49adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg480
2010-10-21 18:28:33adminsetmessages: + msg479
2010-10-21 18:28:33adminsetmessages: + msg478
2010-10-21 18:28:33adminsetmessages: + msg477
2010-10-21 18:28:33adminsetmessages: + msg476
2009-03-12 00:00:00admincreate