-
Notifications
You must be signed in to change notification settings - Fork 27
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
JavaKit: Passing objects between threads #157
Labels
Comments
It's not a huge issue because I can schedule things on the main thread but, would be nice to not need to do this (to avoid excess context switches). |
ktoso
changed the title
Passing objects between threads
JavaKit: Passing objects between threads
Nov 7, 2024
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 7, 2024
…jects may be passed between threads. Fixes: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 7, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
I just did this for now – PADL@c3f2314 – but obviously it's a workaround. I think I need upstream input as to what the right solution is, whether we remove |
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 8, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 8, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 8, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 8, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 8, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 8, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 9, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 9, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 9, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 9, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 9, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 9, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
lhoward
added a commit
to PADL/swift-java
that referenced
this issue
Nov 9, 2024
This is not a real fix, I suspect the real fix is to remove javaEnvironment as an instance variable on all platforms and always use the ambient environment (as the JNI specification clearly states the environment cannot be shared between threads). Works around: swiftlang#157
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
javaMethodLookup()
uses the environment attached to the object, probably it should use the ambient (thread-specific) environment or the one that is passed in?From the JNI specs:
So, I think this is a bug. Is the fix as simple as adding an
environment
argument tojavaMethodLookup()
?The text was updated successfully, but these errors were encountered: