summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/watchdog.h
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-04-15 16:01:35 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-04-15 16:01:35 +0200
commit37c94e3373e18bd71095bf736ba5105bf3b04e2e (patch)
treef61d632fef40057353cbb9f5ca427dda2b092154 /src/osd/watchdog.h
parentbd04e5b17dcf679cd8618a02e97ce957d2c62865 (diff)
Update windows to use platform independent watchdog implementation (nw)
Diffstat (limited to 'src/osd/watchdog.h')
-rw-r--r--src/osd/watchdog.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/osd/watchdog.h b/src/osd/watchdog.h
new file mode 100644
index 00000000000..f9c06e72bb0
--- /dev/null
+++ b/src/osd/watchdog.h
@@ -0,0 +1,36 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert, R. Belmont
+#ifndef _watchdog_h_
+#define _watchdog_h_
+//============================================================
+//
+// watchdog.h - watchdog handling
+//
+// SDLMAME by Olivier Galibert and R. Belmont
+//
+//============================================================
+
+#include "osdsync.h"
+#include <atomic>
+#include <thread>
+
+class watchdog
+{
+public:
+ watchdog(void);
+ ~watchdog(void);
+
+ void reset() { m_event.set(); }
+
+ osd_event & event(void) { return m_event; }
+ INT32 do_exit(void) { return m_do_exit; }
+ osd_ticks_t getTimeout(void) { return m_timeout; }
+ void setTimeout(int timeout);
+private:
+ osd_event m_event;
+ std::thread* m_thread;
+ std::atomic<INT32> m_do_exit;
+
+ osd_ticks_t m_timeout;
+};
+#endif