-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Spec] {.threadvar.} and destructors #12624
Comments
They are not injected but the real question is whether that's really good enough... Likewise, collecting all threadlocal destructors into a single one is not modular and requires a heavier threading implementation than I would like. We probably need to do the same as: https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables |
IMO we should ensure that destructors are inserted, even if this only holds for C++, and even if that only holds furthermore for >= C++11 (until we implement this for C backend as well or tlsEmulation:off). That's the most sensible behavior for correctnesss / usefulness. note that now that #16750 was merged, for question@Araq are nim destructors mapped to a C++ destructor on C++ backend? and does it depend on --gc:arc|default? if so, then looks like this provides a full solution for C++11 (and we must also ensure that nim destructor for a type Foo has same behavior as |
As discussed on IRC (https://irclogs.nim-lang.org/07-11-2019.html#18:25:52), the spec doesn't cover if destructors are inserted for thread-local variable before thread destruction.
It should say clearly if they are or if they are not.
The text was updated successfully, but these errors were encountered: