harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r467446 - in /incubator/harmony/enhanced/drlvm/trunk/vm/thread/src: thread_native_basic.c thread_native_condvar.c thread_native_park.c
Date Tue, 24 Oct 2006 19:33:52 GMT
Author: geirm
Date: Tue Oct 24 12:33:51 2006
New Revision: 467446

URL: http://svn.apache.org/viewvc?view=rev&rev=467446
Log:
HARMONY-1823

VM throws RuntimeException in AWT-EventDispatchThread with JET and OPT on all platforms

Verified failure with InterruptTest

Applied interrupt_fix.patch and states.patch

InterruptTest now passes

Also on Ubuntu 6 c-unit, smoke, ~kernel



Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c
    incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_condvar.c
    incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c?view=diff&rev=467446&r1=467445&r2=467446
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c Tue Oct 24
12:33:51 2006
@@ -121,7 +121,6 @@
     }
 
     new_thread->priority = priority ? priority : HYTHREAD_PRIORITY_NORMAL;
-    new_thread->state = TM_THREAD_STATE_ALIVE;
     //new_thread->suspend_request = suspend ? 1 : 0;
     
     start_proc_data = (thread_start_proc_data *) apr_palloc(new_thread->pool, sizeof(thread_start_proc_data));
@@ -590,7 +589,7 @@
     thread_set_self(thread);
     assert(thread == tm_self_tls);
 
-    thread->state = TM_THREAD_STATE_ALIVE | TM_THREAD_STATE_RUNNABLE;
+    thread->state |= TM_THREAD_STATE_ALIVE | TM_THREAD_STATE_RUNNABLE;
     
     if (!thread->thread_id) {
         ++next_id;

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_condvar.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_condvar.c?view=diff&rev=467446&r1=467445&r2=467446
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_condvar.c (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_condvar.c Tue Oct 24
12:33:51 2006
@@ -59,6 +59,8 @@
 
         // check interrupted flag
     if (interruptable && (this_thread->state & TM_THREAD_STATE_INTERRUPTED))
{
+        // clean interrupted flag
+        this_thread->state &= (~TM_THREAD_STATE_INTERRUPTED);
                 return TM_ERROR_INTERRUPT;
     }
 
@@ -74,6 +76,8 @@
    
     // check interrupted flag
     if (interruptable &&  (this_thread->state & TM_THREAD_STATE_INTERRUPTED))
{
+        // clean interrupted flag
+        this_thread->state &= (~TM_THREAD_STATE_INTERRUPTED);
                 return TM_ERROR_INTERRUPT;
     }
 

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c?view=diff&rev=467446&r1=467445&r2=467446
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c Tue Oct 24 12:33:51
2006
@@ -47,9 +47,17 @@
  * @see hythread_unpark
  */
 IDATA VMCALL hythread_park(I_64 millis, IDATA nanos) {
+     IDATA status;
      hythread_t t = tm_self_tls;     
      assert(t);
-     return hysem_wait_interruptable(t->park_event, millis, nanos);
+     status = hysem_wait_interruptable(t->park_event, millis, nanos);
+     //the status should be restored for j.u.c.LockSupport
+     ////
+     if (status == TM_ERROR_INTERRUPT) {
+         t->state |= TM_THREAD_STATE_INTERRUPTED;
+     }
+
+     return status;
 }
 
 /**



Mime
View raw message