Summary:
Most of the times the callback stores a reference to a variable in scope
where the `Future` is in. When the scope is left the reference get's
dangling. `CancelOrWait` is called in multiple places (mostly
destructors) to ensure the callback isn't executed anymore.
This patch deduplicates thous calls to `CancelOrWait`.
Refs: #5874
Comments by: @Stan, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5208
This was SVN commit r28128.
The Function is not restricted to std::function anymore. Move only
function become possible.
Differential Revision: https://code.wildfiregames.com/D4840
This was SVN commit r27962.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful
Will add linter rule in seperate commit
Happy recompiling everyone!
Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
If the pathfinding tasks are running, they might reference now-deleted
variables. CancelOrWait prevents this.
Remove `Future::Cancel()` altogether as that was its only use and the
functions seems dangerous.
Introduced with 0ebc08b13c
Patch by: phosit
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D4831
This was SVN commit r27310.
std::optional was not usable when our Future class was introduced, but
it is now, so we can replace SharedStateResult with it, reducing custom
code.
Note that Apple Clang has some incompatibilites with part of the
optional interface, but it isn't used here.
Patch by: phosit
Comments by: vladislavbelov
Accepted by: wraitii
Differential Revision: https://code.wildfiregames.com/D4803
This was SVN commit r27309.
Tasks are simple callables (e.g. lambdas), and can be pushed with 2
priority levels. Pushing a task returns a future.
Futures can be waited on, can return results, and can be cancelled
deterministically. Futures can also not be waited on.
This gives 'hardware concurrency - 1' threads to maximize CPU usage in a
work-stealing workflow.
Reviewed by: vladislavbelov
Refs #5874
Differential Revision: https://code.wildfiregames.com/D3848
This was SVN commit r25656.