summaryrefslogtreecommitdiff
path: root/src/thread
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/thread.h5
-rw-r--r--src/thread/thread_os2.cpp4
-rw-r--r--src/thread/thread_pthread.cpp6
-rw-r--r--src/thread/thread_win32.cpp4
4 files changed, 12 insertions, 7 deletions
diff --git a/src/thread/thread.h b/src/thread/thread.h
index 98c48d15d..83eeb73eb 100644
--- a/src/thread/thread.h
+++ b/src/thread/thread.h
@@ -12,8 +12,10 @@
#ifndef THREAD_H
#define THREAD_H
+/** Definition of all thread entry functions. */
typedef void (*OTTDThreadFunc)(void *);
+/** Signal used for signalling we knowingly want to end the thread. */
class OTTDThreadExitSignal { };
/**
@@ -52,6 +54,9 @@ public:
*/
class ThreadMutex {
public:
+ /**
+ * Create a new mutex.
+ */
static ThreadMutex *New();
/**
diff --git a/src/thread/thread_os2.cpp b/src/thread/thread_os2.cpp
index c6c7db7df..903ea0ebe 100644
--- a/src/thread/thread_os2.cpp
+++ b/src/thread/thread_os2.cpp
@@ -93,8 +93,8 @@ private:
*/
class ThreadMutex_OS2 : public ThreadMutex {
private:
- HMTX mutex;
- HEV event;
+ HMTX mutex; ///< The mutex.
+ HEV event; ///< Event for waiting.
public:
ThreadMutex_OS2()
diff --git a/src/thread/thread_pthread.cpp b/src/thread/thread_pthread.cpp
index ab46c0a0a..11cd3accd 100644
--- a/src/thread/thread_pthread.cpp
+++ b/src/thread/thread_pthread.cpp
@@ -95,9 +95,9 @@ private:
*/
class ThreadMutex_pthread : public ThreadMutex {
private:
- pthread_mutex_t mutex;
- pthread_cond_t condition;
- pthread_mutexattr_t attr;
+ pthread_mutex_t mutex; ///< The actual mutex.
+ pthread_cond_t condition; ///< Data for conditional waiting.
+ pthread_mutexattr_t attr; ///< Attributes set for the mutex.
public:
ThreadMutex_pthread()
diff --git a/src/thread/thread_win32.cpp b/src/thread/thread_win32.cpp
index a3b2d3734..1e7d0731e 100644
--- a/src/thread/thread_win32.cpp
+++ b/src/thread/thread_win32.cpp
@@ -106,8 +106,8 @@ private:
*/
class ThreadMutex_Win32 : public ThreadMutex {
private:
- CRITICAL_SECTION critical_section;
- HANDLE event;
+ CRITICAL_SECTION critical_section; ///< The critical section we would enter.
+ HANDLE event; ///< Event for signalling.
public:
ThreadMutex_Win32()