-
Notifications
You must be signed in to change notification settings - Fork 471
Thread detach hook for Java JNI on Android #259
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
Conversation
@swift-ci please test |
Thanks @MadCoder, good to have this tied down. While you’re here, there are in fact three problems building libdispatch on Android which you can probably provide an authoritative answer on. The first is membarrier is not available:
And the seems to be some problem with the MACRO “TRASHIT”
And finally libdispatch needs to be linked to libswiftCore.so while it is being built. Do you want me to file a new PR for the solutions to the first two problems? |
This review is not the place to discuss it. however, the dispatch once thing is wrong on android, arm gives no such promise. |
Any suggestions as to what the proper solution might be? |
see #228 . If you aren't fluent with arm memory model, you should leave that patch to someone who does. |
Fair enough. WIll do. Thanks for your help |
Thread detach hook for Java JNI on Android Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
This is a resubmission of a callback hook required when mixing multi threaded Swift and Java on Android. When Java JNI has been used on a thread the thread needs to be detached from JNI before the thread exits to free local variables or the application will crash e.g. https://github.com/SwiftJava/java_swift/blob/master/Sources/JavaJNI.swift#L25.
Introducing this hook gives any future Java integration code a chance to do this.