-
Notifications
You must be signed in to change notification settings - Fork 270
Cannot construct an object as a static variable in a function #207
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
Comments
This is supported too, if you use the circle-stdlib project. In Circle itself you can add the following to your project Makefile before the include statement for Rules.mk to suppress the errors:
Because Circle doesn't have a preemptive scheduler, this should work. |
But it's a problem if you use multiple cores.
It seems I really need to integrate circle-stdlib into my project :) |
That's true. Unfortunately the precise semantics of |
I understand. There's a open source implementation (cxa_guard.cxx) that maybe could be used, but that's not critical and entire up to you. The license is this one I believe. For now I just have the |
Thanks for the link! I will see, what I can do. |
Requires the implementation of the functions __cxa_guard_acquire() and __cxa_guard_release(), which will be automatically used by the compiler. Issue #207
This feature has been implemented on the develop branch now. |
This feature has been implemented in Circle 44. So this can be closed. |
I have a function to create a singleton of a class, but the linker complains about some missing functions.
These functions prevent the static variables from being initialized more than once should two threads try to get the singleton at the same time. I'm using an
#idef
to special case it when building with Circle, but I think it would be better if Circle supported it directly.The text was updated successfully, but these errors were encountered: