From: Rafael Garcia-Suarez Date: Mon, 20 Sep 2004 17:13:20 +0000 (+0000) Subject: Upgrade to Time::HiRes 1.65. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=64a7a97c20dd04240e4f413ed151ebe43591df37;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Time::HiRes 1.65. p4raw-id: //depot/perl@23329 --- diff --git a/ext/Time/HiRes/Changes b/ext/Time/HiRes/Changes index 06d2eff..6277ea6 100644 --- a/ext/Time/HiRes/Changes +++ b/ext/Time/HiRes/Changes @@ -1,5 +1,23 @@ Revision history for Perl extension Time::HiRes. +1.65 + - one should not mix u?alarm and sleep (the tests modified + by 1.65, #12 and #13, hung in Solaris), now we just busy + loop executing an empty block + - in the documentation underline the unspecificity of mixing + sleeps and alarms + - small spelling fixes + +1.64 + - regenerate ppport.h with Devel::PPPort 3.03, + now the MY_CXT_CLONE is defined in ppport.h, + we no more need to do that. + + - the test #12 would often hang in sigsuspend() (at least that's + where Mac OS X' ktrace shows it hanging). With the sleep()s + changed to sleep(1)s, the tests still pass but no hang after + a few hundred repeats. + 1.63 - Win32 and any ithread build: ppport.h didn't define MY_CXT_CLONE, which seems to be a Time-HiResism. diff --git a/ext/Time/HiRes/HiRes.pm b/ext/Time/HiRes/HiRes.pm index 057b983..e47e09c 100644 --- a/ext/Time/HiRes/HiRes.pm +++ b/ext/Time/HiRes/HiRes.pm @@ -15,7 +15,7 @@ require DynaLoader; d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer d_nanosleep); -$VERSION = '1.63'; +$VERSION = '1.65'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -104,8 +104,8 @@ it will fail at compile time. If your subsecond sleeping is implemented with C instead of C, you can mix subsecond sleeping with signals since -C does not use signals. This, however is unportable, and -you should first check for the truth value of +C does not use signals. This, however, is not portable, +and you should first check for the truth value of C<&Time::HiRes::d_nanosleep> to see whether you have nanosleep, and then carefully read your C C API documentation for any peculiarities. (There is no separate interface to call @@ -138,6 +138,8 @@ unlike the C system call. See also C below. Issues a C call; the C<$interval_useconds> is optional and will be zero if unspecified, resulting in C-like behaviour. +Note that the interaction between alarms and sleeps are unspecified. + =item tv_interval tv_interval ( $ref_to_gettimeofday [, $ref_to_later_gettimeofday] ) @@ -164,7 +166,7 @@ default floating point format of Perl and the seconds since epoch have conspired to produce an apparent bug: if you print the value of C you seem to be getting only five decimals, not six as promised (microseconds). Not to worry, the microseconds are -there (assuming your platform supports such granularity in first +there (assuming your platform supports such granularity in the first place). What is going on is that the default floating point format of Perl only outputs 15 digits. In this case that means ten digits before the decimal separator and five after. To see the microseconds @@ -175,10 +177,12 @@ seconds and microseconds as two separate values. =item sleep ( $floating_seconds ) Sleeps for the specified amount of seconds. Returns the number of -seconds actually slept (a floating point value). This function can be -imported, resulting in a nice drop-in replacement for the C +seconds actually slept (a floating point value). This function can +be imported, resulting in a nice drop-in replacement for the C provided with perl, see the L below. +Note that the interaction between alarms and sleeps are unspecified. + =item alarm ( $floating_seconds [, $interval_floating_seconds ] ) The C signal is sent after the specified number of seconds. @@ -187,19 +191,21 @@ is optional and will be zero if unspecified, resulting in C-like behaviour. This function can be imported, resulting in a nice drop-in replacement for the C provided with perl, see the L below. -B: With some operating system and Perl release combinations -C restarts C, instead of interuping it. -This means that an C followed by a C -may together take the sum of the times specified for the the -C and the C, not just the time of the C. +B: With some combinations of operating systems and Perl +releases C restarts C, instead of interrupting it. +This means that an C followed by a C may together +take the sum of the times specified for the the C and the +C, not just the time of the C. + +Note that the interaction between alarms and sleeps are unspecified. =item setitimer ( $which, $floating_seconds [, $interval_floating_seconds ] ) Start up an interval timer: after a certain time, a signal arrives, -and more signals may keep arriving at certain intervals. To disable a -timer, use C<$floating_seconds> of zero. If the C<$interval_floating_seconds> -is set to zero (or unspecified), the timer is disabled B the -next delivered signal. +and more signals may keep arriving at certain intervals. To disable +an "itimer", use C<$floating_seconds> of zero. If the +C<$interval_floating_seconds> is set to zero (or unspecified), the +timer is disabled B the next delivered signal. Use of interval timers may interfere with C, C, and C. In standard-speak the "interaction is unspecified", diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index 2fb9d23..76352e2 100644 --- a/ext/Time/HiRes/HiRes.xs +++ b/ext/Time/HiRes/HiRes.xs @@ -24,18 +24,6 @@ extern "C" { } #endif -#ifdef START_MY_CXT -# ifndef MY_CXT_CLONE -# define MY_CXT_CLONE \ - dMY_CXT_SV; \ - my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ - Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t); \ - sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) -# endif -#else -# define MY_CXT_CLONE NOOP -#endif - #ifndef PerlProc_pause # define PerlProc_pause() Pause() #endif @@ -43,7 +31,7 @@ extern "C" { #ifdef HAS_PAUSE # define Pause pause #else -# define Pause() sleep(~0) +# define Pause() sleep(~0) /* Zzz for a long time. */ #endif /* Though the cpp define ITIMER_VIRTUAL is available the functionality diff --git a/ext/Time/HiRes/Makefile.PL b/ext/Time/HiRes/Makefile.PL index 449129b..2f191cc 100644 --- a/ext/Time/HiRes/Makefile.PL +++ b/ext/Time/HiRes/Makefile.PL @@ -470,7 +470,6 @@ sub main { unless (exists $ENV{PERL_CORE} && $ENV{PERL_CORE}) { print <