in reply to Re^2: Threads, Tk, Time, oh my!
in thread Threads, Tk, Time, oh my!
Aah - yeah, this part looks fishy, or at least prone to trigger thread+locale-based conflicts:
if (defined $time) { local $ENV{TZ} = 'America/New_York'; my $est = Time::Piece::localtime()->tzoffset; $time = 'Time::Piece'->strptime($time, '%Y-%m-%d %H:%M:%S') - $est + $tzoffset; } else {
Manipulating the timezone is weirdly(?) not threadsafe, or at least that's what I remember from some Perl tickets.
Update: You could calculate the timezone once at program startup, that could eliminate the switching of the timezone within a thread.
|
|---|