]> granicus.if.org Git - php/commitdiff
remove dead code
authorAnatol Belski <ab@php.net>
Wed, 20 May 2015 17:02:43 +0000 (19:02 +0200)
committerAnatol Belski <ab@php.net>
Wed, 20 May 2015 17:14:06 +0000 (19:14 +0200)
win32/time.c

index e437da995c5a556807560d0cd4d9c04207c03122..f2487af9fc842b88c98011ee94571aa3728c41e1 100644 (file)
@@ -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