Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Std/Multithreading/ReturnValue

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

To return a value from your worker thread, use a std::future<> return-value-getter object, whose get() function will block your client thread if the worker thread hasn't yet called set_value() on a corresponding std::promise<> return-value-setter object. Additional information about returning a value from a thread (includes interactive examples)