Proposal to remove unused macro ngx_sleep()

Hello,

ngx_sleep() macro is unused.

regards,

yves

HG changeset patch

User Yves Crespin[email protected]

Date 1407420247 -7200

Node ID 8120c2937062998497546a3ecb38b78bb302fe34

Parent 97fcc94109c0ea7b929f7fa5a8c7ee95ecf7cb5c

remove unused ngx_sleep() macro

In win32 implementation, even for a long sleep (60s), ngx_msleep()
is used instead of ngx_sleep().
Implementation of |sleep()| can use |SIGALRM| and it’s used in nginx.

diff -r 97fcc94109c0 -r 8120c2937062 src/os/unix/ngx_time.h
— a/src/os/unix/ngx_time.h Thu Aug 07 15:04:43 2014 +0200
+++ b/src/os/unix/ngx_time.h Thu Aug 07 16:04:07 2014 +0200
@@ -60,7 +60,6 @@

#define ngx_gettimeofday(tp) (void) gettimeofday(tp, NULL);
#define ngx_msleep(ms) (void) usleep(ms * 1000)
-#define ngx_sleep(s) (void) sleep(s)

#endif /* NGX_TIME_H_INCLUDED */

Posted at Nginx Forum:

Hello!

On Thu, Aug 07, 2014 at 10:05:16AM -0400, crespin wrote:

User Yves Crespin[email protected]

Date 1407420247 -7200

Node ID 8120c2937062998497546a3ecb38b78bb302fe34

Parent 97fcc94109c0ea7b929f7fa5a8c7ee95ecf7cb5c

remove unused ngx_sleep() macro

In win32 implementation, even for a long sleep (60s), ngx_msleep()
is used instead of ngx_sleep().
Implementation of |sleep()| can use |SIGALRM| and it’s used in nginx.

I would rather not.
It’s sometimes useful for debugging.


Maxim D.
http://nginx.org/