svn commit: r233345 - head/lib/libc/gen

Jilles Tjoelker jilles at stack.nl
Fri Mar 23 21:30:42 UTC 2012


On Fri, Mar 23, 2012 at 08:26:32AM +0000, Ed Schouten wrote:
> Author: ed
> Date: Fri Mar 23 08:26:31 2012
> New Revision: 233345
> URL: http://svn.freebsd.org/changeset/base/233345

> Log:
>   Make utmpx(3) thread safe if we support TLS.

>   Because the utmpx interface is generally not required to be thread-safe,
>   but it is nice to have, if easy to do so. Therefore don't make a mess
>   out of the code and only use it if __NO_TLS is not defined.

Hmm, I think this is a portability trap, at least as long it is
supported to have a platform with threading but without __NO_TLS.

Besides, I am not sure if this functionality is worth 12 or 20 bytes of
memory per thread because most applications do not use it. I think a
pthread_key_create() when the first thread calls an utmpx function
optimizes for the case where utmpx is not used or used by only one
thread.

A reason to make utmpx thread-safe could be that glibc does it or
popular applications (almost) need it.

-- 
Jilles Tjoelker


More information about the svn-src-all mailing list