mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
remove dead code
This commit is contained in:
parent
a6190359ad
commit
514aa4ef53
1 changed files with 0 additions and 84 deletions
84
win32/time.c
84
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue