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 2008/01/21 15:31:44 UTC

svn commit: r613902 - /harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c

Author: gshimansky
Date: Mon Jan 21 06:31:44 2008
New Revision: 613902

URL: http://svn.apache.org/viewvc?rev=613902&view=rev
Log:
Applied patch from HARMONY-5403
[drlvm][thread] regression after Thread.interrupt refactoring


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

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c?rev=613902&r1=613901&r2=613902&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c Mon Jan 21 06:31:44 2008
@@ -127,8 +127,12 @@
     assert(status == TM_ERROR_NONE);
 
     if (thread->state & TM_THREAD_STATE_PARKED) {
+        thread->state &= ~TM_THREAD_STATE_PARKED;
         mon = thread->waited_monitor;
         assert(mon);
+        status = hymutex_unlock(&thread->mutex);
+        assert(status == TM_ERROR_NONE);
+
         // Notify parked thread
         status = hymutex_lock(&mon->mutex);
         assert(status == TM_ERROR_NONE);
@@ -138,9 +142,7 @@
         assert(status == TM_ERROR_NONE);
     } else {
         thread->state |= TM_THREAD_STATE_UNPARKED;
+        status = hymutex_unlock(&thread->mutex);
+        assert(status == TM_ERROR_NONE);
     }
-
-    thread->state &= ~TM_THREAD_STATE_PARKED;
-    status = hymutex_unlock(&thread->mutex);
-    assert(status == TM_ERROR_NONE);
 }