8067680: (sctp) Possible race initializing native IDs
authorrobm
Thu, 29 Jan 2015 14:59:42 +0000
changeset 28680 79674c06a625
parent 28679 42f73a4a323b
child 28681 fc0698dfbb23
8067680: (sctp) Possible race initializing native IDs Reviewed-by: chegar, rriggs
jdk/src/jdk.sctp/unix/native/libsctp/SctpNet.c
--- a/jdk/src/jdk.sctp/unix/native/libsctp/SctpNet.c	Wed Jan 28 04:56:00 2015 -0800
+++ b/jdk/src/jdk.sctp/unix/native/libsctp/SctpNet.c	Thu Jan 29 14:59:42 2015 +0000
@@ -316,11 +316,12 @@
     if (isaCls == 0) {
         jclass c = (*env)->FindClass(env, "java/net/InetSocketAddress");
         CHECK_NULL(c);
+        isaCtrID = (*env)->GetMethodID(env, c, "<init>",
+                                     "(Ljava/net/InetAddress;I)V");
+        CHECK_NULL(isaCtrID);
         isaCls = (*env)->NewGlobalRef(env, c);
         CHECK_NULL(isaCls);
         (*env)->DeleteLocalRef(env, c);
-        isaCtrID = (*env)->GetMethodID(env, isaCls, "<init>",
-                                     "(Ljava/net/InetAddress;I)V");
     }
 }