| 2736 | } |
| 2737 | |
| 2738 | static int start_timer_thread(void) |
| 2739 | { |
| 2740 | timer_event = CreateEvent(NULL, FALSE, FALSE, NULL); |
| 2741 | if (timer_event) { |
| 2742 | timer_thread = (HANDLE) _beginthreadex(NULL, 0, ticktack, NULL, 0, NULL); |
| 2743 | if (!timer_thread ) { |
| 2744 | errno = ENOMEM; |
| 2745 | return error("cannot start timer thread"); |
| 2746 | } |
| 2747 | } else { |
| 2748 | errno = ENOMEM; |
| 2749 | return error("cannot allocate resources for timer"); |
| 2750 | } |
| 2751 | return 0; |
| 2752 | } |
| 2753 | |
| 2754 | static void stop_timer_thread(void) |
| 2755 | { |