C++ 11 thread_local and “foreign” threads
C++ 11 thread_local and “foreign” threads
I would like to use C++ 11 thread_local, but our application embeds a JVM, and sometimes C++ methods are called from Java-created thread via JNI. This is essentially the same problem as if an external "C" library created a thread and called back into my C++ code. Is the behavior of thread_local variables defined under these circumstances? Is there any way for my code to compensate for the unexpected appearance of a foreign thread? What about destruction on thread exit?
Thanks
john
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.