Page MenuHomeWildfire Games

Catch exceptions from tasks
Needs ReviewPublic

Authored by phosit on Feb 23 2023, 8:59 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

It's now possible te get an exception from a function in a task.
The interface is like std::future: if you call .Get() you will get the result (as before) or the exception will be thrown.
I changed the pathfinder to call .Get to get possible exceptions.

I made the texture converter use exception as an example. I think it fit's nice. It's not an esential part.

I don't know if this also does handle windows structured exceptions. See: https://learn.microsoft.com/en-us/cpp/cpp/transporting-exceptions-between-threads
Ref: #5874

Test Plan

Caus the texture manager to fail.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

phosit requested review of this revision.Feb 23 2023, 8:59 PM
phosit created this revision.
phosit added inline comments.May 2 2023, 9:08 PM
source/graphics/TextureConverter.cpp
507–508

The element should be poped before .Get is called.

source/graphics/TextureManager.cpp
706

ok is useless now