timezones and thread safety

From: Date: Tue, 17 Apr 2001 21:35:38 +0000
Subject: timezones and thread safety
Groups: php.dev 
Request: Send a blank email to php-dev+get-51829@lists.php.net to get a copy of this message
there are quite a few bug entries that deal with timezones and the TZ environment veriable... they're marked as closed and reentered in each version release. from what I can gather from the code, it's still not fixed. localtime_r does not set the global tzname from TZ when called. I believe this is for thread safety, but does bad things when TZ changes values between time function calls. if php is changed to use localtime instead of localtime_r, then timezone stuff works, but thread safety is gone. the same goes with calling tzset manually. so is there an easy way to deal with this and fix it the right way without doing something like saving TZ values by thead and doing lock;set-tz-env;tzset;function;unlock every time a tz dependent function is called? I'm running php as an apache 1.x module, so I just hacked in a userspace tzset(TZ) function, but this would be bad for systems that need to play nicely with threads. --jlp

« previous php.dev (#51829) next »