aboutsummaryrefslogtreecommitdiff
path: root/os-win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'os-win32.c')
-rw-r--r--os-win32.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/os-win32.c b/os-win32.c
index c7f6b5c6b0..50b7f6f885 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -23,6 +23,7 @@
* THE SOFTWARE.
*/
#include <windows.h>
+#include <mmsystem.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
@@ -67,9 +68,19 @@ static BOOL WINAPI qemu_ctrl_handler(DWORD type)
return TRUE;
}
+static TIMECAPS mm_tc;
+
+static void os_undo_timer_resolution(void)
+{
+ timeEndPeriod(mm_tc.wPeriodMin);
+}
+
void os_setup_early_signal_handling(void)
{
SetConsoleCtrlHandler(qemu_ctrl_handler, TRUE);
+ timeGetDevCaps(&mm_tc, sizeof(mm_tc));
+ timeBeginPeriod(mm_tc.wPeriodMin);
+ atexit(os_undo_timer_resolution);
}
/* Look for support files in the same directory as the executable. */