This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] #13594: Avoid race in nscd


> +/* Copyright (C) 1998-2012  Free Software Foundation, Inc.

Excess space here.

>   @@ -100,9 +99,27 @@ libc_freeres_fn (hst_map_free)

Looks like a pasting problem in the patch.

> +  while (__builtin_expect
> +	 (atomic_compare_and_exchange_val_acq (&__hst_map_handle.lock,
> +					       1, 0) != 0, 0))
> +    {
> +      /* XXX Best number of rounds?  */
> +      if (__builtin_expect (++cnt > 5, 0))
> +	return 0;

Why limit the rounds?  Is it even kosher to return zero here?
What effect does it have?

> -    return 0;
> +    retval =  0;

Excess space here.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]