remove dead code

This commit is contained in:
Anatol Belski 2015-05-20 19:02:43 +02:00
parent a6190359ad
commit 514aa4ef53

View 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 ); 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: * Local variables:
* tab-width: 4 * tab-width: 4