(08-20-2012, 02:13 AM)FakeTruth Wrote: As I stated in a commit log, callling Java functions from C++ is only allowed from a Java thread (not native thread). It's possible to call those functions from other threads, but it's messy. Threads need to be attached and detached to the JVM, confusing stuffs...
I think the easiest way is to create a message queue in C++. The log (or whatever that needs to communicate with Java) would add messages (instanced classes with a function, like Java's Runnable) to a queue. Then a Java thread will call a C++ function that reads these messages and execute them. This way we can be absolutely sure that these functions are always called from a Java thread (we know it will have enough memory etc.) without messing with attaching and detaching threads to the JVM