[FFmpeg-devel] [RFC] avoid non-threadsafe localtime, gmtime

Reimar Döffinger Reimar.Doeffinger
Sat Feb 7 16:19:22 CET 2009


On Sat, Feb 07, 2009 at 02:18:09PM +0100, Reimar D?ffinger wrote:
> On Sat, Feb 07, 2009 at 01:24:19PM +0100, Michael Niedermayer wrote:
> > On Sat, Feb 07, 2009 at 12:02:03PM +0100, Reimar D?ffinger wrote:
> > > attached patch would be the first step to get rid of the non-threadsafe
> > > localtime and gmtime functions.
> > > It should work on all POSIX and current Windows versions.
> > > For anything else it would still be a simple hack to add support to
> > > fallback to the non-threadsafe functions, only libavformat then would
> > > not be thread-safe which keeps the probability of issues quite low.
> > 
> > fine, though i must add the ifdefs are ugly
> 
> If you find that ugly, you'll certainly be jumping with joy at the end
> of the email.

Even better, when using localtime_r you must ensure that someone called
the (possibly non-thread-safe) tzset function before.
Didn't anyone have their brains with them when they designed that mess?




More information about the ffmpeg-devel mailing list