Hi All,
I'm using pthread(C++) programming in Solaris 9 and find that localtime is
not thread safe. Is it true?
From pstack result, I found 2 process hang for
----------------- lwp# 1 / thread# 1 --------------------
febc5dd4 lwp_park (0, 0, 0)
febc25b4 slow_lock (97030, fe850000, 0, 0, 0, 0) + 58
fe8bc718 getenv (fe929e20, 756a0, 0, 0, 0, 0) + 1c
fe8c6970 getsystemTZ (0, 77838, 0, 0, 0, 0) + 14
fe8c47d8 ltzset_u (422d0a21, 77f7c, 0, 0, 0, 0) + 14
fe8c4094 localtime (ffbeb5d4, 9b19c, ffbeb5d4, 0, 0, 0) + 14
....
----------------- lwp# 5 / thread# 5 --------------------
febc5dd4 lwp_park (0, 0, 0)
febc25b4 slow_lock (97030, fe850800, 0, 0, 0, 0) + 58
fe8bc718 getenv (fe929e20, 756a0, 0, 0, 0, 0) + 1c
fe8c6970 getsystemTZ (0, 77838, 0, 0, 0, 0) + 14
fe8c47d8 ltzset_u (422d0a22, 77f7c, 0, 0, 0, 0) + 14
fe8c4094 localtime (fda7bf3c, ff16269b, fda7bf3c, 0, 0, fda7bf2c) + 14
Is there solution for this?
Thanks.
Franklin