mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Remove PHP_SLEEP_NON_VOID as it is not useful anymore
This commit is contained in:
parent
e710862f8c
commit
662afc80f8
4 changed files with 5 additions and 9 deletions
|
@ -2972,7 +2972,7 @@ PHP_FUNCTION(flush)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void sleep(int seconds)
|
||||
/* {{{ proto int sleep(int seconds)
|
||||
Delay for a given number of seconds */
|
||||
PHP_FUNCTION(sleep)
|
||||
{
|
||||
|
@ -2986,12 +2986,8 @@ PHP_FUNCTION(sleep)
|
|||
zend_value_error("Number of seconds must be greater than or equal to 0");
|
||||
return;
|
||||
}
|
||||
#ifdef PHP_SLEEP_NON_VOID
|
||||
RETURN_LONG(php_sleep((unsigned int)num));
|
||||
#else
|
||||
php_sleep((unsigned int)num);
|
||||
#endif
|
||||
|
||||
RETURN_LONG(php_sleep((unsigned int)num));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ set_time_limit(20);
|
|||
$time_start = microtime(true);
|
||||
|
||||
// Sleep for a while
|
||||
sleep($sleeptime);
|
||||
$result = sleep($sleeptime);
|
||||
|
||||
// Test passes if sleeps for at least 98% of specified time
|
||||
$sleeplow = $sleeptime - ($sleeptime * 2 /100);
|
||||
|
@ -29,6 +29,7 @@ $time_end = microtime(true);
|
|||
$time = $time_end - $time_start;
|
||||
|
||||
echo "Thread slept for " . $time . " seconds\n";
|
||||
echo "Return value: " . $result . "\n";
|
||||
|
||||
if ($time >= $sleeplow) {
|
||||
echo "TEST PASSED\n";
|
||||
|
@ -40,5 +41,6 @@ if ($time >= $sleeplow) {
|
|||
--EXPECTF--
|
||||
*** Testing sleep() : basic functionality ***
|
||||
Thread slept for %f seconds
|
||||
Return value: 0
|
||||
TEST PASSED
|
||||
===DONE===
|
||||
|
|
|
@ -294,7 +294,6 @@ END_EXTERN_C()
|
|||
|
||||
/* global variables */
|
||||
#if !defined(PHP_WIN32)
|
||||
#define PHP_SLEEP_NON_VOID
|
||||
#define php_sleep sleep
|
||||
extern char **environ;
|
||||
#endif /* !defined(PHP_WIN32) */
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
/* its in win32/time.c */
|
||||
#define HAVE_USLEEP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
#define PHP_SLEEP_NON_VOID 1
|
||||
|
||||
#define HAVE_GETCWD 1
|
||||
#define NEED_ISBLANK 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue