So, as an example I have this JNI code:
/** This literally does nothing. It's purpose is to call the static initializer early to detect if we have issues before loading. */
public static void nothing() {
}
static {
// should be loaded by CLib
if (CLib.hasGNUTLS() == 1) {
globalinit();
}
}
I find myself literally creating a function called "nothing" to call it early if necessary, but I also want it called if it's referenced earlier or if we don't call nothing()
. Now, I could do some nasty logic involving checking a boolean, but then you get into thread safety, and blah. I suppose you could, but it's not pretty. Is there a way to explicitly call GNUTLS.<clinit>();
?