Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 90707 invoked from network); 31 Oct 2006 01:39:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Oct 2006 01:39:27 -0000 Received: (qmail 99430 invoked by uid 500); 31 Oct 2006 01:39:38 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 99396 invoked by uid 500); 31 Oct 2006 01:39:38 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 99350 invoked by uid 99); 31 Oct 2006 01:39:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2006 17:39:37 -0800 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2006 17:39:25 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id EDBF01A9846; Mon, 30 Oct 2006 17:39:02 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r469335 - /incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c Date: Tue, 31 Oct 2006 01:39:02 -0000 To: harmony-commits@incubator.apache.org From: wjwashburn@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061031013902.EDBF01A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wjwashburn Date: Mon Oct 30 17:39:02 2006 New Revision: 469335 URL: http://svn.apache.org/viewvc?view=rev&rev=469335 Log: HARMONY-1929, [drlvm][threading] 16-bit atomic op is used on a 32-bit value build and "build test" runs on windowsxp and linux w/ gcc 4.0.2 Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c?view=diff&rev=469335&r1=469334&r2=469335 ============================================================================== --- incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c (original) +++ incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c Mon Oct 30 17:39:02 2006 @@ -32,11 +32,8 @@ #include #include "thread_private.h" #include -#include -static void thread_safe_point_impl(hythread_t thread); -int16 atomic16_inc(int16 *value); -int16 atomic16_dec(int16 *value); +static void thread_safe_point_impl(hythread_t thread); /** @name Safe suspension support */ @@ -199,15 +196,15 @@ assert(thread->suspend_request >=0); // already suspended? if(thread->suspend_request > 0) { - atomic16_inc((int16 *)&(thread->suspend_request)); - return; + apr_atomic_inc32((apr_uint32_t *)&(thread->suspend_request)); + return; } //we realy need to suspend thread. hysem_set(thread->resume_event, 0); - atomic16_inc((int16 *)&(thread->suspend_request)); + apr_atomic_inc32((apr_uint32_t *)&(thread->suspend_request)); apr_thread_yield_other(thread->os_handle); @@ -248,7 +245,7 @@ void VMCALL hythread_suspend() { hythread_t thread = tm_self_tls; - atomic16_inc((int16 *)&(thread->suspend_request)); + apr_atomic_inc32((apr_uint32_t *)&(thread->suspend_request)); hythread_safe_point(); } @@ -319,7 +316,7 @@ // printf("resume other now lock %d %d %d %d\n",tm_self_tls->thread_id,tm_self_tls->suspend_disable_count,thread->thread_id,thread->suspend_disable_count); if(thread->suspend_request > 0) { if (thread->safepoint_callback && thread->suspend_request < 2) return; - atomic16_dec((int16 *)&(thread->suspend_request)); + apr_atomic_dec32((apr_uint32_t *)&(thread->suspend_request)); if(thread->suspend_request == 0) { // Notify the thread that it may wake up now hysem_post(thread->resume_event); @@ -475,25 +472,5 @@ thread_safe_point_impl(self); } } -int16 atomic16_inc(int16 *value) -{ - int16 old_value=*value; - while(port_atomic_cas16((volatile apr_uint16_t*)value,(apr_uint16_t)(old_value+1),(apr_uint16_t)old_value)!=old_value) - { - old_value=*value; - } - - return old_value+1; -} -int16 atomic16_dec(int16 *value) -{ - int16 old_value=*value; - while(port_atomic_cas16((volatile apr_uint16_t*)value,(apr_uint16_t)(old_value-1),(apr_uint16_t)old_value)!=old_value) - { - old_value=*value; - } - return old_value-1; -} - //@}