You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating and destroying a unifex::v2::async_scope without using it for anything results in an assertion failure:
Assertion failed: join_started(), file unifex/v2/async_scope.hpp, line 90
This can come up if the scope is a member of a class, and another member's constructor throws, e.g.:
classC {
unifex::async_scope scope;
TypeWhoseConstructorThrows m;
};
Is this the intended behavior?
It's understandable that one doesn't want to special-case the destructor's contract, but on the other hand it is quite odd not to be able to destroy a default-constructed object.
I'm not really sure if this can be easily worked around though without overhead for release builds. Maybe the scope could start in some kind of special state (say, std::size_t(-1)) and transition out of it in try_record_start(), but guarded by #ifndef NDEBUG?
The text was updated successfully, but these errors were encountered:
Thanks for bringing this up Andrey! This is definitely a bug and not a feature. Our standards proposal for async_scope addresses this problem by keeping track of some state. This is probably an opportunity for us to implement this as well for unifex::v2::async_scope..
Creating and destroying a
unifex::v2::async_scope
without using it for anything results in an assertion failure:This can come up if the scope is a member of a class, and another member's constructor throws, e.g.:
Is this the intended behavior?
It's understandable that one doesn't want to special-case the destructor's contract, but on the other hand it is quite odd not to be able to destroy a default-constructed object.
I'm not really sure if this can be easily worked around though without overhead for release builds. Maybe the scope could start in some kind of special state (say,
std::size_t(-1)
) and transition out of it intry_record_start()
, but guarded by#ifndef NDEBUG
?The text was updated successfully, but these errors were encountered: