MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / my_os_timer_reset

Function my_os_timer_reset

mysys/kqueue_timers.c:178–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176*/
177
178int
179my_os_timer_reset(my_timer_t *timer, int *state)
180{
181 int status;
182 struct kevent kev;
183
184 EV_SET(&kev, timer->id, EVFILT_TIMER, EV_DELETE, 0, 0, NULL);
185
186 status= kevent(kq_fd, &kev, 1, NULL, 0, NULL);
187
188 /*
189 If the event was retrieved from the kqueue (at which point we
190 consider it to be signaled), the timer was automatically deleted.
191 */
192 if (!status)
193 *state= 1;
194 else if (errno == ENOENT)
195 {
196 *state= 0;
197 status= 0;
198 }
199
200 return status;
201}
202
203
204/**

Callers

nothing calls this directly

Calls 1

keventClass · 0.85

Tested by

no test coverage detected