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/10/12 19:17:30 UTC
svn commit: r584203 - in /harmony/enhanced/drlvm/trunk/vm:
thread/src/thread_native_basic.c vmcore/src/thread/thread_java_basic.cpp
Author: gshimansky
Date: Fri Oct 12 10:17:29 2007
New Revision: 584203
URL: http://svn.apache.org/viewvc?rev=584203&view=rev
Log:
Applied patch from HARMONY-4930
[drlvm][jvmti][jdwp] 4 JDWP unit test VirtualMachine.SuspendTest failed
Modified:
harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c
harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp
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=584203&r1=584202&r2=584203&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 Fri Oct 12 10:17:29 2007
@@ -540,10 +540,6 @@
assert(status == TM_ERROR_NONE);
assert(thread->os_handle);
-
- hymutex_lock(&thread->mutex);
- thread->state |= TM_THREAD_STATE_ALIVE;
- hymutex_unlock(&thread->mutex);
if (!thread->thread_id) {
char free_slot_found = 0;
@@ -580,6 +576,10 @@
thread->prev = prev;
prev->next = cur->prev = thread;
+ hymutex_lock(&thread->mutex);
+ thread->state |= TM_THREAD_STATE_ALIVE | TM_THREAD_STATE_RUNNABLE;
+ hymutex_unlock(&thread->mutex);
+
status = hythread_global_unlock();
assert(status == TM_ERROR_NONE);
@@ -681,7 +681,7 @@
if (hythread_lib_state() != TM_LIBRARY_STATUS_INITIALIZED) {
// set TERMINATED state
hymutex_lock(&thread->mutex);
- thread->state |= TM_THREAD_STATE_TERMINATED;
+ thread->state = TM_THREAD_STATE_TERMINATED;
hymutex_unlock(&thread->mutex);
// set hythread_self()
@@ -704,7 +704,7 @@
return 0;
}
- // register to group and set ALIVE state
+ // register to group and set ALIVE & RUNNABLE states
status = hythread_set_to_group(thread, start_proc_data.group);
assert(status == TM_ERROR_NONE);
@@ -716,11 +716,6 @@
status = hythread_set_priority(thread, thread->priority);
// FIXME - cannot set priority
//assert(status == TM_ERROR_NONE);
-
- // set RUNNABLE state
- hymutex_lock(&thread->mutex);
- thread->state |= TM_THREAD_STATE_RUNNABLE;
- hymutex_unlock(&thread->mutex);
// release hythread global lock
status = hythread_global_unlock();
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp?rev=584203&r1=584202&r2=584203&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp Fri Oct 12 10:17:29 2007
@@ -98,7 +98,7 @@
return 0;
}
- // register to group and set ALIVE state
+ // register to group and set ALIVE & RUNNABLE states
status = hythread_set_to_group(native_thread, start_proc_data.hy_data.group);
assert(status == TM_ERROR_NONE);
@@ -134,15 +134,6 @@
assert(status == TM_ERROR_NONE);
}
- // set RUNNABLE state
- status = hythread_thread_lock(native_thread);
- assert(status == TM_ERROR_NONE);
- IDATA state = hythread_get_state(native_thread);
- status = hythread_set_state(native_thread, state | TM_THREAD_STATE_RUNNABLE);
- assert(status == TM_ERROR_NONE);
- status = hythread_thread_unlock(native_thread);
- assert(status == TM_ERROR_NONE);
-
// increase started thread count
jthread_start_count();
@@ -183,7 +174,7 @@
status = hythread_thread_lock(native_thread);
assert(status == TM_ERROR_NONE);
// FIXME - remove INTERRUPTED state after TM state transition complete
- state = hythread_get_state(native_thread);
+ IDATA state = hythread_get_state(native_thread);
status = hythread_set_state(native_thread,
TM_THREAD_STATE_TERMINATED | (TM_THREAD_STATE_INTERRUPTED & state));
assert(status == TM_ERROR_NONE);