You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gs...@apache.org on 2007/12/06 20:28:00 UTC

svn commit: r601823 - in /harmony/enhanced/drlvm/trunk: build/make/excludes/ vm/thread/src/ vm/thread/src/linux/

Author: gshimansky
Date: Thu Dec  6 11:27:59 2007
New Revision: 601823

URL: http://svn.apache.org/viewvc?rev=601823&view=rev
Log:
Applied patch from HARMONY-3581
[drlvm][shutdown][interpreter] stress.Sync crashes on shutdown on interpreter on Linux


Modified:
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int
    harmony/enhanced/drlvm/trunk/vm/thread/src/linux/os_thread.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_interrupt.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_private.h

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int?rev=601823&r1=601822&r2=601823&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int (original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.int Thu Dec  6 11:27:59 2007
@@ -10,9 +10,6 @@
 # HARMONY-2772 fails intermittently 
 stress/Mix.java
 
-# HARMONY-3581 crashes quite often
-stress/Sync.java
-
 # HARMONY-3917
 gc/PhantomReferenceTest.java
 gc/WeakReferenceTest.java

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/linux/os_thread.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/linux/os_thread.c?rev=601823&r1=601822&r2=601823&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/linux/os_thread.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/linux/os_thread.c Thu Dec  6 11:27:59 2007
@@ -154,8 +154,13 @@
  */
 int os_thread_join(osthread_t os_thread)
 {
-    void *status;
-    return pthread_join(os_thread, &status);
+    int error;
+
+    do {
+        // FIXME - somehow pthread_join returns before thread is terminated
+        error = pthread_join(os_thread, NULL);
+    } while (error != ESRCH && error != EINVAL && error != EDEADLK);
+    return 0;
 }
 
 /**

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c?rev=601823&r1=601822&r2=601823&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c Thu Dec  6 11:27:59 2007
@@ -496,6 +496,7 @@
     osthread_t os_handle = thread->os_handle;
     hythread_detach(thread);
     os_thread_cancel(os_handle);
+    os_thread_join(os_handle);
 }
 
 /** 

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_interrupt.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_interrupt.c?rev=601823&r1=601822&r2=601823&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_interrupt.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_interrupt.c Thu Dec  6 11:27:59 2007
@@ -47,8 +47,9 @@
 
     // If thread was doing any kind of wait, notify it.
     if (thread->state & (TM_THREAD_STATE_PARKED | TM_THREAD_STATE_SLEEPING)) {
-        if (thread->current_condition) {
-            status = hycond_notify_all(thread->current_condition);
+        hycond_t *condition = thread->current_condition;
+        if (condition) {
+            status = hycond_notify_all(condition);
             assert(status == TM_ERROR_NONE);
         }
     } else if (thread->state & TM_THREAD_STATE_IN_MONITOR_WAIT) {

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c?rev=601823&r1=601822&r2=601823&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c Thu Dec  6 11:27:59 2007
@@ -338,8 +338,7 @@
     } else {
         // sent an interupt signal for waiting threads
         if (thread->current_condition) {
-            IDATA UNREF status = hycond_notify_all(thread->current_condition);
-            assert(status == TM_ERROR_NONE);
+            hythread_interrupt(thread);
         }
     }
     return TM_ERROR_NONE;

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_private.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_private.h?rev=601823&r1=601822&r2=601823&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_private.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_private.h Thu Dec  6 11:27:59 2007
@@ -313,6 +313,7 @@
 int os_thread_cancel(osthread_t);
 int os_thread_free(osthread_t os_thread);
 void os_thread_exit(IDATA status);
+int os_thread_join(osthread_t os_thread);
 void os_thread_yield_other(osthread_t);
 int os_get_thread_times(osthread_t os_thread, int64* pkernel, int64* puser);