From owner-svn-src-all@FreeBSD.ORG Fri Jan 18 23:08:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 682AFE71; Fri, 18 Jan 2013 23:08:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50D3ECFA; Fri, 18 Jan 2013 23:08:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IN8fmu079364; Fri, 18 Jan 2013 23:08:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IN8fFo079362; Fri, 18 Jan 2013 23:08:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301182308.r0IN8fFo079362@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 18 Jan 2013 23:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245630 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 18 Jan 2013 23:08:41 -0000 Author: jilles Date: Fri Jan 18 23:08:40 2013 New Revision: 245630 URL: http://svnweb.freebsd.org/changeset/base/245630 Log: libthr: Always use the threaded rtld lock implementation. The threaded rtld lock implementation is faster even in the single-threaded case because it postpones signal handlers via THR_CRITICAL_ENTER and THR_CRITICAL_LEAVE instead of calling sigprocmask(2). As a result, exception handling becomes faster in single-threaded applications linked with libthr. Reviewed by: kib Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_kern.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Fri Jan 18 23:04:05 2013 (r245629) +++ head/lib/libthr/thread/thr_init.c Fri Jan 18 23:08:40 2013 (r245630) @@ -363,6 +363,12 @@ _libpthread_init(struct pthread *curthre _thr_signal_init(); if (_thread_event_mask & TD_CREATE) _thr_report_creation(curthread, curthread); + /* + * Always use our rtld lock implementation. + * It is faster because it postpones signal handlers + * instead of calling sigprocmask(2). + */ + _thr_rtld_init(); } } Modified: head/lib/libthr/thread/thr_kern.c ============================================================================== --- head/lib/libthr/thread/thr_kern.c Fri Jan 18 23:04:05 2013 (r245629) +++ head/lib/libthr/thread/thr_kern.c Fri Jan 18 23:08:40 2013 (r245630) @@ -57,11 +57,6 @@ _thr_setthreaded(int threaded) return (0); __isthreaded = threaded; - if (threaded != 0) { - _thr_rtld_init(); - } else { - _thr_rtld_fini(); - } return (0); }