summaryrefslogtreecommitdiff
path: root/src/thread
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-05-01 19:14:12 +0000
committerrubidium <rubidium@openttd.org>2011-05-01 19:14:12 +0000
commit1a515e6344028854c855671c19f49d8f869eb18f (patch)
treee1bba97c1a8fd80f564729cc2d5fc2049110cb2a /src/thread
parentb27dd1dcd7375dae63724879eb0f56dd703e5312 (diff)
downloadopenttd-1a515e6344028854c855671c19f49d8f869eb18f.tar.xz
(svn r22405) -Document: some more "random-ish" tidbits
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()