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/11/19 15:44:23 UTC
svn commit: r596312 -
/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c
Author: gshimansky
Date: Mon Nov 19 06:44:22 2007
New Revision: 596312
URL: http://svn.apache.org/viewvc?rev=596312&view=rev
Log:
Applied patch from HARMONY-5135
[drlvm]DRL VM hangs during stress.Mix running on x86-64
Modified:
harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c
Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c?rev=596312&r1=596311&r2=596312&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c Mon Nov 19 06:44:22 2007
@@ -684,7 +684,8 @@
* Enter locktable read section
*/
static void locktable_reader_enter() {
- hymutex_lock(&lock_table->mutex);
+ IDATA status = hymutex_lock(&lock_table->mutex);
+ assert(status == TM_ERROR_NONE);
if (lock_table->state == HYTHREAD_LOCKTABLE_IDLE
|| (lock_table->state == HYTHREAD_LOCKTABLE_READING
@@ -694,19 +695,21 @@
lock_table->readers_reading++;
} else {
lock_table->readers_waiting++;
- hycond_wait(&lock_table->read, &lock_table->mutex);
+ hycond_wait_timed_raw(&lock_table->read, &lock_table->mutex, 0, 0);
// We are asserting here that we exited wait with the correct state
assert(lock_table->state == HYTHREAD_LOCKTABLE_READING);
}
- hymutex_unlock(&lock_table->mutex);
+ status = hymutex_unlock(&lock_table->mutex);
+ assert(status == TM_ERROR_NONE);
}
/*
* Exit locktable read section
*/
static void locktable_reader_exit() {
- hymutex_lock(&lock_table->mutex);
+ IDATA status = hymutex_lock(&lock_table->mutex);
+ assert(status == TM_ERROR_NONE);
lock_table->readers_reading--;
@@ -719,18 +722,20 @@
}
}
- hymutex_unlock(&lock_table->mutex);
-}
+ status = hymutex_unlock(&lock_table->mutex);
+ assert(status == TM_ERROR_NONE);
+}
/*
* Enter locktable write section
*/
static void locktable_writer_enter() {
- hymutex_lock(&lock_table->mutex);
+ IDATA status = hymutex_lock(&lock_table->mutex);
+ assert(status == TM_ERROR_NONE);
if (lock_table->state != HYTHREAD_LOCKTABLE_IDLE) {
lock_table->writers_waiting++;
- hycond_wait(&lock_table->write, &lock_table->mutex);
+ hycond_wait_timed_raw(&lock_table->write, &lock_table->mutex, 0, 0);
// We are asserting here that we exited wait with the correct state
assert(lock_table->state == HYTHREAD_LOCKTABLE_WRITING);
@@ -740,14 +745,16 @@
lock_table->state = HYTHREAD_LOCKTABLE_WRITING;
}
- hymutex_unlock(&lock_table->mutex);
+ status = hymutex_unlock(&lock_table->mutex);
+ assert(status == TM_ERROR_NONE);
}
/*
* Exit locktable write section
*/
static void locktable_writer_exit() {
- hymutex_lock(&lock_table->mutex);
+ IDATA status = hymutex_lock(&lock_table->mutex);
+ assert(status == TM_ERROR_NONE);
if (lock_table->readers_reading > 0) {
lock_table->readers_reading = lock_table->readers_waiting;
@@ -760,7 +767,8 @@
lock_table->state = HYTHREAD_LOCKTABLE_IDLE;
}
- hymutex_unlock(&lock_table->mutex);
+ status = hymutex_unlock(&lock_table->mutex);
+ assert(status == TM_ERROR_NONE);
}