< prev index next >

jdk/src/java.instrument/share/native/libinstrument/Reentrancy.c

Print this page




  73     error = (*jvmtienv)->SetThreadLocalStorage(
  74                                     jvmtienv,
  75                                     thread,
  76                                     newValue);
  77     check_phase_ret_blob(error, error);
  78 
  79 #if JPLISASSERT_ENABLEASSERTIONS
  80     assertTLSValue( jvmtienv,
  81                     thread,
  82                     newValue);
  83 #endif
  84 
  85     return error;
  86 }
  87 
  88 void
  89 assertTLSValue( jvmtiEnv *      jvmtienv,
  90                 jthread         thread,
  91                 const void *    expected) {
  92     jvmtiError  error;



  93     void *      test = (void *) 0x99999999;

  94 
  95     /* now check if we do a fetch we get what we wrote */
  96     error = (*jvmtienv)->GetThreadLocalStorage(
  97                                 jvmtienv,
  98                                 thread,
  99                                 &test);
 100     check_phase_ret(error);
 101     jplis_assert(error == JVMTI_ERROR_NONE);
 102     jplis_assert(test == expected);
 103 }
 104 
 105 jboolean
 106 tryToAcquireReentrancyToken(    jvmtiEnv *  jvmtienv,
 107                                 jthread     thread) {
 108     jboolean    result      = JNI_FALSE;
 109     jvmtiError  error       = JVMTI_ERROR_NONE;
 110     void *      storedValue = NULL;
 111 
 112     error = (*jvmtienv)->GetThreadLocalStorage(
 113                                 jvmtienv,




  73     error = (*jvmtienv)->SetThreadLocalStorage(
  74                                     jvmtienv,
  75                                     thread,
  76                                     newValue);
  77     check_phase_ret_blob(error, error);
  78 
  79 #if JPLISASSERT_ENABLEASSERTIONS
  80     assertTLSValue( jvmtienv,
  81                     thread,
  82                     newValue);
  83 #endif
  84 
  85     return error;
  86 }
  87 
  88 void
  89 assertTLSValue( jvmtiEnv *      jvmtienv,
  90                 jthread         thread,
  91                 const void *    expected) {
  92     jvmtiError  error;
  93 #if defined _WIN32 && _MSC_VER >= 1900
  94     void *      test = (void *)(uintptr_t) 0x99999999;
  95 #else
  96     void *      test = (void *) 0x99999999;
  97 #endif
  98 
  99     /* now check if we do a fetch we get what we wrote */
 100     error = (*jvmtienv)->GetThreadLocalStorage(
 101                                 jvmtienv,
 102                                 thread,
 103                                 &test);
 104     check_phase_ret(error);
 105     jplis_assert(error == JVMTI_ERROR_NONE);
 106     jplis_assert(test == expected);
 107 }
 108 
 109 jboolean
 110 tryToAcquireReentrancyToken(    jvmtiEnv *  jvmtienv,
 111                                 jthread     thread) {
 112     jboolean    result      = JNI_FALSE;
 113     jvmtiError  error       = JVMTI_ERROR_NONE;
 114     void *      storedValue = NULL;
 115 
 116     error = (*jvmtienv)->GetThreadLocalStorage(
 117                                 jvmtienv,


< prev index next >