Re: [PATCH 0/4] grep: retire `init_grep_defaults()`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Martin,

On Sat, 21 Nov 2020, Martin Ågren wrote:

> Users of the grep machinery need to call `init_grep_defaults()` to
> populate some defaults. There's a comment: "We could let the compiler do
> this, but without C99 initializers the code gets unwieldy and
> unreadable, so...".
>
> We have such initializers now, so we can simplify accordingly.

When I read this at first, I feared that you would change a
`pthread_init_mutex()` to using `PTHREAD_MUTEX_INITIALIZER` instead. On
the face of it, that would look good on paper, but it unfortunately falls
flat for us because there is no Win32 equivalent for the static
initializer: we emulate mutexes via `CRITICAL_SECTION`s, and those need to
be initialized by running a function.

To my surprise and relief, your patches do not do that; The only mutex in
`grep.c` (`grep_attr_mutex`) is not touched.

I just wanted to mention this here, in case anybody else had the same
idea.

Thanks,
Dscho

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux