-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeContext::Attach
returns a unique_ptr
to a Token
, but can not use a subclass
#3034
Comments
To investigate. Not sure there is an issue with the current code, but this could be a posible cleanup or improvement. |
Thanks for the answer. I don't think there is a bug, its just convoluted. It's rather a suggestion for a refactoring/cleanup. I'm happy to provide a patch if you want to. |
I understand that everyone is busy. Is there anything I can do to make this issue more forward? Are you willing to consider pull requests with respect to this issue? Thank you very much for your time. |
Thanks for raising the issue. The key point here is this comment:
About simplifying
About simplifying
Currently, the api is designed in such a way that:
is possible, which is likely to be the case for thread pools. The proposed simplification will break this. |
Thanks for your detailed response. I appreciate it very much!
Sadly, this is not possible as the code is right now, because the only constructor of
Probably this is just an issue with naming things. For me a |
It looks like nobody has implemented a custom runtime storage with a custom token yet then. This is a confirmed bug, the A PR to fix this part will be welcome ;-)
Sure, a However, changing this will break both the API and ABI. |
RuntimeContext::Attach
returns a unique_ptr
to a shared_ptr
RuntimeContext::Attach
returns a unique_ptr
to a Token
, but can not use a subclass
This issue was marked as stale due to lack of activity. |
I'm referring to runtime_context.h. The
Attach
method returns aToken
but wrapped in aunique_ptr
. At the same time theToken
just contains aContext
which is in fact just ashared_ptr
to some data. I guessToken
is supposed to be some kind of guard that ensures that a context is eventually detached.Are my assumptions correct?
If so, then we don't need an allocation of a
Token
for that. Instead makeToken
a proper guard type, that semantically behaves like aunique_ptr
. Is it possible to change that or am I missing something? Would this be considered a breaking api change?I'm happy to provide a patch.
The text was updated successfully, but these errors were encountered: