Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 2009 01:50:32 +0200
From:      Dmitry Pryanishnikov <lynx.ripe@gmail.com>
To:        Edwin Groothuis <edwin@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r194783 - head/lib/libc/stdtime
Message-ID:  <4B01E548.7040708@gmail.com>

next in thread | raw e-mail | index | archive | help

Hello!

> Author: edwin
> Date: Tue Jun 23 22:28:44 2009
> New Revision: 194783
> URL: http://svn.freebsd.org/changeset/base/194783
> 
> Log:
>   Remove duplicate if-statement on gmt_is_set in gmtsub().
>   
>   MFC after:	1 week
> 
> Modified:
>   head/lib/libc/stdtime/localtime.c
> 
> Modified: head/lib/libc/stdtime/localtime.c
> ==============================================================================
> --- head/lib/libc/stdtime/localtime.c	Tue Jun 23 22:22:20 2009	(r194782)
> +++ head/lib/libc/stdtime/localtime.c	Tue Jun 23 22:28:44 2009	(r194783)
> @@ -1472,18 +1472,16 @@ struct tm * const	tmp;
>  {
>  	register struct tm *	result;
>  
> +	_MUTEX_LOCK(&gmt_mutex);
>  	if (!gmt_is_set) {
> -		_MUTEX_LOCK(&gmt_mutex);
> -		if (!gmt_is_set) {

   This change looks like a (small?) pessimization to me: before it, 
_MUTEX_LOCK/_MUTEX_UNLOCK pair would be skipped for the case gmt_is_set 
== TRUE (all invocations except the first one), now it won't. I'm not 
sure whether this is critical here though...


Sincerely, Dmitry
-- 
nic-hdl: LYNX-RIPE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B01E548.7040708>