@@ -116,90 +116,6 @@ PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp )
116
116
return usleep ( rqtp -> tv_sec * 1000000 + rqtp -> tv_nsec / 1000 );
117
117
}
118
118
119
- #if 0 /* looks pretty ropey in here */
120
- #ifdef HAVE_SETITIMER
121
-
122
-
123
- #ifndef THREAD_SAFE
124
- unsigned int proftimer , virttimer , realtimer ;
125
- extern LPMSG phpmsg ;
126
- #endif
127
-
128
- struct timer_msg {
129
- int signal ;
130
- unsigned int threadid ;
131
- };
132
-
133
-
134
- LPTIMECALLBACK setitimer_timeout (UINT uTimerID , UINT info , DWORD dwUser , DWORD dw1 , DWORD dw2 )
135
- {
136
- struct timer_msg * msg = (struct timer_msg * ) info ;
137
-
138
- if (msg ) {
139
- raise ((int ) msg -> signal );
140
- PostThreadMessage (msg -> threadid ,
141
- WM_NOTIFY , msg -> signal , 0 );
142
- free (msg );
143
- }
144
- return 0 ;
145
- }
146
-
147
- PHPAPI int setitimer (int which , const struct itimerval * value , struct itimerval * ovalue )
148
- {
149
- int timeout = value -> it_value .tv_sec * 1000 + value -> it_value .tv_usec ;
150
- int repeat = TIME_ONESHOT ;
151
-
152
- /*make sure the message queue is initialized */
153
- PeekMessage (phpmsg , NULL , WM_USER , WM_USER , PM_NOREMOVE );
154
- if (timeout > 0 ) {
155
- struct timer_msg * msg = malloc (sizeof (struct timer_msg ));
156
- msg -> threadid = GetCurrentThreadId ();
157
- if (!ovalue ) {
158
- repeat = TIME_PERIODIC ;
159
- }
160
- switch (which ) {
161
- case ITIMER_REAL :
162
- msg -> signal = SIGALRM ;
163
- realtimer = timeSetEvent (timeout , 100 , (LPTIMECALLBACK ) setitimer_timeout , (UINT ) msg , repeat );
164
- break ;
165
- case ITIMER_VIRT :
166
- msg -> signal = SIGVTALRM ;
167
- virttimer = timeSetEvent (timeout , 100 , (LPTIMECALLBACK ) setitimer_timeout , (UINT ) msg , repeat );
168
- break ;
169
- case ITIMER_PROF :
170
- msg -> signal = SIGPROF ;
171
- proftimer = timeSetEvent (timeout , 100 , (LPTIMECALLBACK ) setitimer_timeout , (UINT ) msg , repeat );
172
- break ;
173
- default :
174
- errno = EINVAL ;
175
- return -1 ;
176
- break ;
177
- }
178
- } else {
179
- switch (which ) {
180
- case ITIMER_REAL :
181
- timeKillEvent (realtimer );
182
- break ;
183
- case ITIMER_VIRT :
184
- timeKillEvent (virttimer );
185
- break ;
186
- case ITIMER_PROF :
187
- timeKillEvent (proftimer );
188
- break ;
189
- default :
190
- errno = EINVAL ;
191
- return -1 ;
192
- break ;
193
- }
194
- }
195
-
196
-
197
- return 0 ;
198
- }
199
-
200
- #endif
201
- #endif
202
-
203
119
/*
204
120
* Local variables:
205
121
* tab-width: 4
0 commit comments