* scm_current_time, scm_gettimeofday, SCM_DEFER_INTS
@ 2003-08-25 22:03 Kevin Ryde
2003-08-29 23:29 ` Kevin Ryde
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2003-08-25 22:03 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 190 bytes --]
* stime.c (scm_current_time, scm_gettimeofday): Remove SCM_DEFER_INTS,
time() and gettimeofday() should be thread safe and unaffected by
temporary timezone changes.
[-- Attachment #2: stime.c.defer-time.diff --]
[-- Type: text/plain, Size: 779 bytes --]
--- stime.c.~1.79.~ 1970-01-01 10:00:00.000000000 +1000
+++ stime.c 2003-08-23 14:22:05.000000000 +1000
@@ -188,10 +188,8 @@
{
timet timv;
- SCM_DEFER_INTS;
if ((timv = time (0)) == -1)
SCM_SYSERROR;
- SCM_ALLOW_INTS;
return scm_long2num((long) timv);
}
#undef FUNC_NAME
@@ -207,10 +205,8 @@
#ifdef HAVE_GETTIMEOFDAY
struct timeval time;
- SCM_DEFER_INTS;
if (gettimeofday (&time, NULL) == -1)
SCM_SYSERROR;
- SCM_ALLOW_INTS;
return scm_cons (scm_long2num ((long) time.tv_sec),
scm_long2num ((long) time.tv_usec));
#else
@@ -223,10 +219,8 @@
# else
timet timv;
- SCM_DEFER_INTS;
if ((timv = time (0)) == -1)
SCM_SYSERROR;
- SCM_ALLOW_INTS;
return scm_cons (scm_long2num (timv), SCM_MAKINUM (0));
# endif
#endif
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: scm_current_time, scm_gettimeofday, SCM_DEFER_INTS
2003-08-25 22:03 scm_current_time, scm_gettimeofday, SCM_DEFER_INTS Kevin Ryde
@ 2003-08-29 23:29 ` Kevin Ryde
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Ryde @ 2003-08-29 23:29 UTC (permalink / raw)
I wrote:
> * stime.c (scm_current_time, scm_gettimeofday): Remove SCM_DEFER_INTS,
> time() and gettimeofday() should be thread safe and unaffected by
> temporary timezone changes.
Oh, actually I guess they are affected on a DOS system (eg. djgpp)
where the system clock is local time rather than UTC. I might put
some comments as a reminder of that.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-08-29 23:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-25 22:03 scm_current_time, scm_gettimeofday, SCM_DEFER_INTS Kevin Ryde
2003-08-29 23:29 ` Kevin Ryde
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).