Changes

Jump to: navigation, search

GPU621/CamelCaseTeam

No change in size, 17:26, 27 July 2021
no edit summary
});
</syntaxhighlight>
 
We need to decide If we want to wait for it to finish (join) or If we want it to run in the background (detach) before the thread object being deconstructed, because it will call std::terminate in the deconstructor and throw a error in runtime.
3. functor
std::thread c(f);
</syntaxhighlight>
We need to decide If we want to wait for it to finish (join) or If we want it to run in the background (detach) before the thread object being deconstructed, because it will call std::terminate in the deconstructor and throw a error in runtime.
t.join() -------- synchronized function called in parent thread to wait for the child thread to finish.
 
t.detach() ------- let threads to run in the background.
10
edits

Navigation menu