| 2752 | } |
| 2753 | |
| 2754 | static void stop_timer_thread(void) |
| 2755 | { |
| 2756 | if (timer_event) |
| 2757 | SetEvent(timer_event); /* tell thread to terminate */ |
| 2758 | if (timer_thread) { |
| 2759 | int rc = WaitForSingleObject(timer_thread, 10000); |
| 2760 | if (rc == WAIT_TIMEOUT) |
| 2761 | error("timer thread did not terminate timely"); |
| 2762 | else if (rc != WAIT_OBJECT_0) |
| 2763 | error("waiting for timer thread failed: %lu", |
| 2764 | GetLastError()); |
| 2765 | CloseHandle(timer_thread); |
| 2766 | } |
| 2767 | if (timer_event) |
| 2768 | CloseHandle(timer_event); |
| 2769 | timer_event = NULL; |
| 2770 | timer_thread = NULL; |
| 2771 | } |
| 2772 | |
| 2773 | static inline int is_timeval_eq(const struct timeval *i1, const struct timeval *i2) |
| 2774 | { |