microsoft / arcana.cpp

Arcana.cpp is a collection of helpers and utility code for low overhead, cross platform C++ implementation of task-based asynchrony.
MIT License
78 stars 24 forks source link

No destroy cancellation none #26

Closed syntheticmagus closed 4 years ago

syntheticmagus commented 4 years ago

This change addresses a problem we were encountering in Babylon Native where cancellation::none was getting torn down by one thread while another thread still needed it to exist. A proposal, referenced in a comment in the code, exists to standardize a mechanism for handling this type of error:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1247r0.html

However, since this proposal is not yet standard, I instead adopted one of the alternatives listed in the proposal to resolve this problem for now. This change has been tested and confirmed to solve the problem Babylon Native was exhibiting.