Open masterav10 opened 6 years ago
The only thing that makes a deamon thread different from a normal thread is that the JVM will terminate the process even when daemon threads are still running. If that's not an issue for your application or your library, there's nothing special about JavaCPP here. Are you worried about anything in particular?
Wasn't sure if exiting while during a callback transition had the potential to cause a JVM crash. I'm guessing this is unlikely to be a problem, as that is the whole point of the daemon. I'll make the change.
Some native libraries might not like it and crash the JVM. That's entirely possible.
So, in the end, have you encountered any issue?
I made the change and tested it against my Decklink FFmpeg build. When I go to register the logging callback, it seems to block indefinitely. There are still a couple of things I can try, however. I'll keep you posted.
What does the code look like?
I'd like for the JNI code to attach as a daemon thread. This will allow my applications to cleanly exit when using the hack provided #143. It will also be useful when I finish my bindings for Decklink, which will likely be function pointer based. Does anyone foresee an issue with doing this? I'd be happy to put up a pull request and test it with my build of FFmpeg later this week.
See this line in the generator.