From 5ca2761441f19daae5e9ee9a6f5ddac950d80a1a Mon Sep 17 00:00:00 2001 From: Salikh Zakirov Date: Wed, 22 Nov 2006 18:05:03 +0300 Subject: [PATCH] Remove NO_COND_VARS stuff --- vm/thread/src/thread_native_fat_monitor.c | 35 +---------------------------- 1 files changed, 1 insertions(+), 34 deletions(-) diff --git a/vm/thread/src/thread_native_fat_monitor.c b/vm/thread/src/thread_native_fat_monitor.c index 480c425..c070726 100644 --- a/vm/thread/src/thread_native_fat_monitor.c +++ b/vm/thread/src/thread_native_fat_monitor.c @@ -160,9 +160,6 @@ IDATA VMCALL hythread_monitor_exit(hythr } -//Use this define to workaround poor condition variables implmentation. -//If defined, local wait scheme implementation will be used; -//#define NO_COND_VARS IDATA monitor_wait_impl(hythread_monitor_t mon_ptr, I_64 ms, IDATA nano, IDATA interruptable) { IDATA status; int saved_recursion; @@ -182,26 +179,6 @@ IDATA monitor_wait_impl(hythread_monitor mon_ptr->owner = NULL; mon_ptr->recursion_count =0; -#ifdef NO_COND_VARS - assert(mon_ptr->owner != self); - status=hythread_monitor_exit(mon_ptr); - if (status != TM_ERROR_NONE) return status; - - saved_disable_count = reset_suspend_disable(); - ms = ms*1000; - while (--ms != 0 && mon_ptr->notify_flag!=1) { - hythread_yield(); - } - if (ms == 0) { - status = TM_ERROR_TIMEOUT; - } else { - status = TM_ERROR_NONE; - } - status=hythread_monitor_enter(mon_ptr); - if (status != TM_ERROR_NONE) return status; - set_suspend_disable(saved_disable_count); - -#else mon_ptr->wait_count++; hymutex_lock(self->mutex); self->current_condition = mon_ptr->condition; @@ -242,7 +219,7 @@ IDATA monitor_wait_impl(hythread_monitor self->current_condition = NULL; hymutex_unlock(self->mutex); mon_ptr->wait_count--; -#endif + if (self->suspend_request) { hymutex_unlock(mon_ptr->mutex); hythread_safe_point(); @@ -347,13 +324,8 @@ IDATA VMCALL hythread_monitor_notify_all if (mon_ptr->owner != tm_self_tls) { return TM_ERROR_ILLEGAL_STATE; } -#ifdef NO_COND_VARS - mon_ptr->notify_flag=1; - return TM_ERROR_NONE; -#else mon_ptr->notify_flag = mon_ptr->wait_count; return hycond_notify_all(mon_ptr->condition); -#endif } @@ -374,14 +346,9 @@ IDATA VMCALL hythread_monitor_notify(hyt if (mon_ptr->owner != tm_self_tls) { return TM_ERROR_ILLEGAL_STATE; } -#ifdef NO_COND_VARS - mon_ptr->notify_flag=1; - return TM_ERROR_NONE; -#else if (mon_ptr->notify_flag < mon_ptr->wait_count) mon_ptr->notify_flag += 1; return hycond_notify(mon_ptr->condition); -#endif } -- 1.4.4.g10f8