From owner-svn-src-all@FreeBSD.ORG Sat Sep 25 04:21:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3E06106564A; Sat, 25 Sep 2010 04:21:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B303B8FC14; Sat, 25 Sep 2010 04:21:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P4LVSu049176; Sat, 25 Sep 2010 04:21:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P4LVVh049174; Sat, 25 Sep 2010 04:21:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009250421.o8P4LVVh049174@svn.freebsd.org> From: David Xu Date: Sat, 25 Sep 2010 04:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213154 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 04:21:31 -0000 Author: davidxu Date: Sat Sep 25 04:21:31 2010 New Revision: 213154 URL: http://svn.freebsd.org/changeset/base/213154 Log: Simplify code, and in while loop, fix operator to match the unwinding direction. Modified: head/lib/libthr/thread/thr_exit.c Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Sat Sep 25 01:57:47 2010 (r213153) +++ head/lib/libthr/thread/thr_exit.c Sat Sep 25 04:21:31 2010 (r213154) @@ -140,17 +140,14 @@ thread_unwind_stop(int version, _Unwind_ /* XXX assume stack grows down to lower address */ cfa = _Unwind_GetCFA(context); - if (actions & _UA_END_OF_STACK) { - done = 1; - } else if (cfa >= (uintptr_t)curthread->unwind_stackend) { + if (actions & _UA_END_OF_STACK || + cfa >= (uintptr_t)curthread->unwind_stackend) { done = 1; } while ((cur = curthread->cleanup) != NULL && - (done || - ((uintptr_t)cur < (uintptr_t)curthread->unwind_stackend && - (uintptr_t)cur >= cfa))) { - __pthread_cleanup_pop_imp(1); + (done || (uintptr_t)cur <= cfa)) { + __pthread_cleanup_pop_imp(1); } if (done)