com php-src: remove dead code: win32/time.c
| From: | Anatol Belski | Date: | Wed, 20 May 2015 17:14:06 +0000 |
| Subject: | com php-src: remove dead code: win32/time.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86827@lists.php.net to get a copy of this message | ||
Commit: 514aa4ef5362d94e857c0b43d839b15d266eafd2
Author: Anatol Belski <ab@php.net> Wed, 20 May 2015 19:02:43 +0200
Parents: a6190359adc931e46a81e7603b80311654ff3ac1
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=514aa4ef5362d94e857c0b43d839b15d266eafd2
Log:
remove dead code
Changed paths:
M win32/time.c
Diff:
diff --git a/win32/time.c b/win32/time.c
index e437da9..f2487af 100644
--- a/win32/time.c
+++ b/win32/time.c
@@ -116,90 +116,6 @@ PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp )
return usleep( rqtp->tv_sec * 1000000 + rqtp->tv_nsec / 1000 );
}
-#if 0 /* looks pretty ropey in here */
-#ifdef HAVE_SETITIMER
-
-
-#ifndef THREAD_SAFE
-unsigned int proftimer, virttimer, realtimer;
-extern LPMSG phpmsg;
-#endif
-
-struct timer_msg {
- int signal;
- unsigned int threadid;
-};
-
-
-LPTIMECALLBACK setitimer_timeout(UINT uTimerID, UINT info, DWORD dwUser, DWORD dw1, DWORD dw2)
-{
- struct timer_msg *msg = (struct timer_msg *) info;
-
- if (msg) {
- raise((int) msg->signal);
- PostThreadMessage(msg->threadid,
- WM_NOTIFY, msg->signal, 0);
- free(msg);
- }
- return 0;
-}
-
-PHPAPI int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)
-{
- int timeout = value->it_value.tv_sec * 1000 + value->it_value.tv_usec;
- int repeat = TIME_ONESHOT;
-
- /*make sure the message queue is initialized */
- PeekMessage(phpmsg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
- if (timeout > 0) {
- struct timer_msg *msg = malloc(sizeof(struct timer_msg));
- msg->threadid = GetCurrentThreadId();
- if (!ovalue) {
- repeat = TIME_PERIODIC;
- }
- switch (which) {
- case ITIMER_REAL:
- msg->signal = SIGALRM;
- realtimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat);
- break;
- case ITIMER_VIRT:
- msg->signal = SIGVTALRM;
- virttimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat);
- break;
- case ITIMER_PROF:
- msg->signal = SIGPROF;
- proftimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat);
- break;
- default:
- errno = EINVAL;
- return -1;
- break;
- }
- } else {
- switch (which) {
- case ITIMER_REAL:
- timeKillEvent(realtimer);
- break;
- case ITIMER_VIRT:
- timeKillEvent(virttimer);
- break;
- case ITIMER_PROF:
- timeKillEvent(proftimer);
- break;
- default:
- errno = EINVAL;
- return -1;
- break;
- }
- }
-
-
- return 0;
-}
-
-#endif
-#endif
-
/*
* Local variables:
* tab-width: 4