summaryrefslogtreecommitdiff
path: root/src/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread.h')
-rw-r--r--src/thread.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/thread.h b/src/thread.h
index 71041e9d7..8225df7d0 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -40,4 +40,27 @@ public:
static bool New(OTTDThreadFunc proc, void *param, ThreadObject **thread = NULL);
};
+/**
+ * Cross-platform Mutex
+ */
+class ThreadMutex {
+public:
+ static ThreadMutex *New();
+
+ /**
+ * Virtual Destructor to avoid compiler warnings.
+ */
+ virtual ~ThreadMutex() {};
+
+ /**
+ * Begin the critical section
+ */
+ virtual void BeginCritical() = 0;
+
+ /**
+ * End of the critical section
+ */
+ virtual void EndCritical() = 0;
+};
+
#endif /* THREAD_H */