author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 21 Feb 2009 08:13:43 +0000 (09:13 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 21 Feb 2009 08:19:07 +0000 (09:19 +0100) | ||
commit | 531779b6deedaf8cb6249c3009380b064cd80c8b | |
tree | 841ebfef2096c64234d7b5b751ba16ba174eb083 | tree | snapshot |
parent | b2bf65d02a4c5d35e1d01f2e2f0e1dc2a1b3995b | commit | diff |
java plugin: Implement a reference counter for the JVMEnv pointers.
This way one thread entering the Java plugin twice, e. g. with the
following call-chain, will not detach itself from the JVM before it is
completely done with it.
The problematic situation is:
-> cjni_read
-> ALLOC JVM
-> `Read' (in Java)
-> `DispatchValues' (in Java)
-> plugin_dispatch_values
-> cjni_write
-> ALLOC JVM (this is a no-op!)
-> `Write' (in Java)
-> DEALLOC JVM
This last dealloc is prematurely, because the thread is not done with
the JVM yet: It'd like to continue and return from `DispatchValues' to
execute some more Java code..
This way one thread entering the Java plugin twice, e. g. with the
following call-chain, will not detach itself from the JVM before it is
completely done with it.
The problematic situation is:
-> cjni_read
-> ALLOC JVM
-> `Read' (in Java)
-> `DispatchValues' (in Java)
-> plugin_dispatch_values
-> cjni_write
-> ALLOC JVM (this is a no-op!)
-> `Write' (in Java)
-> DEALLOC JVM
This last dealloc is prematurely, because the thread is not done with
the JVM yet: It'd like to continue and return from `DispatchValues' to
execute some more Java code..
src/java.c | diff | blob | history |