commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1003757 - in /commons/proper/daemon/trunk: RELEASE-NOTES.txt src/native/windows/src/javajni.c
Date Sat, 02 Oct 2010 09:24:00 GMT
Author: mturk
Date: Sat Oct  2 09:23:58 2010
New Revision: 1003757

URL: http://svn.apache.org/viewvc?rev=1003757&view=rev
Log:
DAEMON-165: Do not clear exceptions from main method. Also use always ExceptionDescribe, not
only in DEBUG mode

Modified:
    commons/proper/daemon/trunk/RELEASE-NOTES.txt
    commons/proper/daemon/trunk/src/native/windows/src/javajni.c

Modified: commons/proper/daemon/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/RELEASE-NOTES.txt?rev=1003757&r1=1003756&r2=1003757&view=diff
==============================================================================
--- commons/proper/daemon/trunk/RELEASE-NOTES.txt (original)
+++ commons/proper/daemon/trunk/RELEASE-NOTES.txt Sat Oct  2 09:23:58 2010
@@ -46,7 +46,7 @@ NEW FEATURES:
 
 BUG FIXES:
 
-1.0.4: DAEMON-95, DAEMON-171, DAEMON-100
+1.0.4: DAEMON-95, DAEMON-171, DAEMON-100, DAEMON-165
 
 1.0.3: DAEMON-108, DAEMON-128, DAEMON-139, DAEMON-143, DAEMON-148,
        DAEMON-135, DAEMON-155, DAEMON-159, DAEMON-161, DAEMON-145, DAEMON-146,

Modified: commons/proper/daemon/trunk/src/native/windows/src/javajni.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/javajni.c?rev=1003757&r1=1003756&r2=1003757&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/src/javajni.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/src/javajni.c Sat Oct  2 09:23:58 2010
@@ -63,7 +63,6 @@ static DYNLOAD_FPTR_DECLARE(SetDllDirect
 #define JVM_EXCEPTION_CHECK(jvm) \
     ((*((jvm)->lpEnv))->ExceptionCheck((jvm)->lpEnv) != JNI_OK)
 
-#ifdef _DEBUG
 #define JVM_EXCEPTION_CLEAR(jvm) \
     APXMACRO_BEGIN                                              \
     if ((jvm)->lpEnv) {                                         \
@@ -72,15 +71,6 @@ static DYNLOAD_FPTR_DECLARE(SetDllDirect
             (*((jvm)->lpEnv))->ExceptionClear((jvm)->lpEnv);    \
         }                                                       \
     } APXMACRO_END
-#else
-#define JVM_EXCEPTION_CLEAR(jvm) \
-    APXMACRO_BEGIN                                              \
-    if ((jvm)->lpEnv) {                                         \
-        if ((*((jvm)->lpEnv))->ExceptionCheck((jvm)->lpEnv)) {  \
-            (*((jvm)->lpEnv))->ExceptionClear((jvm)->lpEnv);    \
-        }                                                       \
-    } APXMACRO_END
-#endif
 
 #define JNI_LOCAL_UNREF(obj) \
         (*(lpJava->lpEnv))->DeleteLocalRef(lpJava->lpEnv, obj)
@@ -843,10 +833,10 @@ static DWORD WINAPI __apxJavaWorkerThrea
     LPAPXJAVAVM lpJava;
     LPAPXJAVA_THREADARGS pArgs = (LPAPXJAVA_THREADARGS)lpParameter;
     APXHANDLE hJava;
-    
+
     hJava = (APXHANDLE)pArgs->hJava;
     if (hJava->dwType != APXHANDLE_TYPE_JVM)
-        WORKER_EXIT(0);
+        WORKER_EXIT(1);
 
     if (!apxJavaInitialize(pArgs->hJava,
                            pArgs->szClassPath,
@@ -878,15 +868,16 @@ static DWORD WINAPI __apxJavaWorkerThrea
               lpJava->clWorker.jClazz,
               lpJava->clWorker.jMethod,
               lpJava->clWorker.jArgs);
-
-    JVM_EXCEPTION_CLEAR(lpJava);
-    __apxJvmDetach(lpJava);
-    apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread %s:%s finished",
-                lpJava->clWorker.sClazz, lpJava->clWorker.sMethod);
+    if (JVM_EXCEPTION_CHECK(lpJava)) {
+        WORKER_EXIT(4);
+    }
+    else {
+        __apxJvmDetach(lpJava);
+    }
 finished:
     lpJava->dwWorkerStatus = 0;
-    apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread finished %s:%s",
-                lpJava->clWorker.sClazz, lpJava->clWorker.sMethod);
+    apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread finished %s:%s with status=%d",
+                lpJava->clWorker.sClazz, lpJava->clWorker.sMethod, rv);
     ExitThread(rv);
     /* never gets here but keep the compiler happy */
     return 0;



Mime
View raw message