I've created a java library in which a thread is started.
When testing this library with a normal java-main method and calling the library, the thread in question just starts fine.
But now I want to call this library from a C dll via JNI.
1) So, the C dll calls a library method foo
via JNI
2) foo
creates a java thread and calls start
on it
3) foo
returns to the C dll caller.
4) Java thread now starts
The problem is that I get a Future
back from the thread and I call get
on it.
This get
blocks forever when the java code is called from the C dll, but works fine when called from another java app.
All other code is running also fine with JNI.
Any ideas how this can happen?
Is the dll or JNI somehow preventing java thread creation?