summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/watchdog.h
diff options
context:
space:
mode:
author Couriersud <couriersud@users.noreply.github.com>2011-01-02 19:12:08 +0000
committer Couriersud <couriersud@users.noreply.github.com>2011-01-02 19:12:08 +0000
commit8386bf94a583165d76ec341cf53fab1ac8e7eb73 (patch)
tree937da0cefea5fe4fb0a925bee6d2fd1344c46944 /src/osd/sdl/watchdog.h
parentde6cb45a966c20d66ee30bcaf03a4261d5f050ae (diff)
Implemented "-watchdog" option for SDLMame. [Couriersud]
Diffstat (limited to 'src/osd/sdl/watchdog.h')
-rw-r--r--src/osd/sdl/watchdog.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/osd/sdl/watchdog.h b/src/osd/sdl/watchdog.h
new file mode 100644
index 00000000000..e1c762c7a8d
--- /dev/null
+++ b/src/osd/sdl/watchdog.h
@@ -0,0 +1,35 @@
+#ifndef _watchdog_h_
+#define _watchdog_h_
+//============================================================
+//
+// watchdog.h - watchdog handling
+//
+// Copyright (c) 1996-2011, Nicola Salmoria and the MAME Team.
+// Visit http://mamedev.org for licensing and usage restrictions.
+//
+// SDLMAME by Olivier Galibert and R. Belmont
+//
+//============================================================
+
+#include "sdlsync.h"
+
+class watchdog
+{
+public:
+ watchdog(void);
+ ~watchdog(void);
+
+ void reset() { osd_event_set(m_event); }
+
+ 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;
+ osd_thread * m_thread;
+ volatile INT32 m_do_exit;
+
+ osd_ticks_t m_timeout;
+};
+#endif