From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:43:40 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 95D831065672; Wed, 6 Jan 2010 20:43:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855578FC08; Wed, 6 Jan 2010 20:43:40 +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 o06Kheb1034290; Wed, 6 Jan 2010 20:43:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06KhebK034288; Wed, 6 Jan 2010 20:43:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001062043.o06KhebK034288@svn.freebsd.org> From: John Baldwin Date: Wed, 6 Jan 2010 20:43:40 +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: r201669 - head/lib/libc/stdtime 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: Wed, 06 Jan 2010 20:43:40 -0000 Author: jhb Date: Wed Jan 6 20:43:40 2010 New Revision: 201669 URL: http://svn.freebsd.org/changeset/base/201669 Log: Use _pthread_once() rather than _once() for localtime() and gmtime(). These methods are only invoked when __isthreaded is true at which point it is safe to use _pthread_once() directly. MFC after: 1 week Modified: head/lib/libc/stdtime/localtime.c Modified: head/lib/libc/stdtime/localtime.c ============================================================================== --- head/lib/libc/stdtime/localtime.c Wed Jan 6 20:41:12 2010 (r201668) +++ head/lib/libc/stdtime/localtime.c Wed Jan 6 20:43:40 2010 (r201669) @@ -1426,7 +1426,7 @@ const time_t * const timep; struct tm *p_tm; if (__isthreaded != 0) { - _once(&localtime_once, localtime_key_init); + _pthread_once(&localtime_once, localtime_key_init); if (localtime_key_error != 0) { errno = localtime_key_error; return(NULL); @@ -1527,7 +1527,7 @@ const time_t * const timep; struct tm *p_tm; if (__isthreaded != 0) { - _once(&gmtime_once, gmtime_key_init); + _pthread_once(&gmtime_once, gmtime_key_init); if (gmtime_key_error != 0) { errno = gmtime_key_error; return(NULL);