comparison src/share/vm/prims/whitebox.hpp @ 17705:ba2cf1fc862b

8034860: Fatal error due to incorrect thread state during nightly testing Summary: use the HAS_PENDING_EXCEPTION and CLEAR_PENDING_EXCEPTION macros Reviewed-by: dholmes, coleenp, dcubed
author ccheung
date Fri, 14 Feb 2014 09:50:17 -0800
parents 56cd09c4a5c9
children 4ca6dc0799b6 4abb719c5620
comparison
equal deleted inserted replaced
17704:56cd09c4a5c9 17705:ba2cf1fc862b
34 34
35 #define WB_ENTRY(result_type, header) JNI_ENTRY(result_type, header) 35 #define WB_ENTRY(result_type, header) JNI_ENTRY(result_type, header)
36 #define WB_END JNI_END 36 #define WB_END JNI_END
37 #define WB_METHOD_DECLARE(result_type) extern "C" result_type JNICALL 37 #define WB_METHOD_DECLARE(result_type) extern "C" result_type JNICALL
38 38
39 #define CHECK_JNI_EXCEPTION_(env, value) \ 39 #define CHECK_JNI_EXCEPTION_(env, value) \
40 do { \ 40 do { \
41 if (env->ExceptionCheck()) { \ 41 JavaThread* THREAD = JavaThread::thread_from_jni_environment(env); \
42 env->ExceptionClear(); \ 42 if (HAS_PENDING_EXCEPTION) { \
43 return(value); \ 43 CLEAR_PENDING_EXCEPTION; \
44 } \ 44 return(value); \
45 } \
45 } while (0) 46 } while (0)
46 47
47 #define CHECK_JNI_EXCEPTION(env) \ 48 #define CHECK_JNI_EXCEPTION(env) \
48 do { \ 49 do { \
49 if (env->ExceptionCheck()) { \ 50 JavaThread* THREAD = JavaThread::thread_from_jni_environment(env); \
50 env->ExceptionClear(); \ 51 if (HAS_PENDING_EXCEPTION) { \
51 return; \ 52 CLEAR_PENDING_EXCEPTION; \
52 } \ 53 return; \
54 } \
53 } while (0) 55 } while (0)
54 56
55 class WhiteBox : public AllStatic { 57 class WhiteBox : public AllStatic {
56 private: 58 private:
57 static bool _used; 59 static bool _used;