public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* localtime_r
@ 2005-02-07  9:01 Keresztfalvi Laszlo
  2005-02-07 11:42 ` localtime_r Will Bryant
  0 siblings, 1 reply; 2+ messages in thread
From: Keresztfalvi Laszlo @ 2005-02-07  9:01 UTC (permalink / raw)
  To: pthreads-win32


Hello,

I've found that localtime_r() is a macro in pthread-win32 simply referencing
the localtime() function. According to the MSDN localtime() works just like
the UNIX version.. each call overwrites the static struct tm storage.

Is this really thread safe?

Thanks,
Laszlo

PS: a simple call like this: localtime_r (&tt, &ttm); causes MinGW to log
"warning: value computed is not used"

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: localtime_r
  2005-02-07  9:01 localtime_r Keresztfalvi Laszlo
@ 2005-02-07 11:42 ` Will Bryant
  0 siblings, 0 replies; 2+ messages in thread
From: Will Bryant @ 2005-02-07 11:42 UTC (permalink / raw)
  To: pthreads-win32

Keresztfalvi Laszlo wrote:

>I've found that localtime_r() is a macro in pthread-win32 simply referencing
>the localtime() function. According to the MSDN localtime() works just like
>the UNIX version.. each call overwrites the static struct tm storage.
>
>Is this really thread safe?
>
>  
>
Yes; it uses a thread-specific buffer on win32.  So it's overwritten 
with every call in that thread.

-- 
Will Bryant
Systems Architect, eCOSM Limited
Mobile +64 21 655 443
http://www.ecosm.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-07 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-07  9:01 localtime_r Keresztfalvi Laszlo
2005-02-07 11:42 ` localtime_r Will Bryant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).