summaryrefslogtreecommitdiff
path: root/src/thread.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-20 03:12:46 +0000
committerrubidium <rubidium@openttd.org>2009-01-20 03:12:46 +0000
commitbb770717494ec94d54edb4c1dd1f5a7a0c830ead (patch)
treef26af7908c8ee5a9d45520a8f2d6aff9f6bfdec6 /src/thread.h
parent5f3772a42c322a99d2ea57b6c97b76fceccbb781 (diff)
downloadopenttd-bb770717494ec94d54edb4c1dd1f5a7a0c830ead.tar.xz
(svn r15158) -Cleanup: remove some unused/unneeded cruft from the thread generalisation.
Diffstat (limited to 'src/thread.h')
-rw-r--r--src/thread.h62
1 files changed, 2 insertions, 60 deletions
diff --git a/src/thread.h b/src/thread.h
index 8d0a8ee84..71041e9d7 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -20,18 +20,6 @@ public:
virtual ~ThreadObject() {};
/**
- * Check if the thread is currently running.
- * @return True if the thread is running.
- */
- virtual bool IsRunning() = 0;
-
- /**
- * Waits for the thread to exit.
- * @return True if the thread has exited.
- */
- virtual bool WaitForStop() = 0;
-
- /**
* Exit this thread.
*/
virtual bool Exit() = 0;
@@ -42,60 +30,14 @@ public:
virtual void Join() = 0;
/**
- * Check if this thread is the current active thread.
- * @return True if it is the current active thread.
- */
- virtual bool IsCurrent() = 0;
-
- /**
- * Get the unique ID of this thread.
- * @return A value unique to each thread.
- */
- virtual uint GetId() = 0;
-
- /**
* Create a thread; proc will be called as first function inside the thread,
* with optinal params.
* @param proc The procedure to call inside the thread.
* @param param The params to give with 'proc'.
+ * @param thread Place to store a pointer to the thread in. May be NULL.
* @return True if the thread was started correctly.
*/
- static ThreadObject *New(OTTDThreadFunc proc, void *param);
-
- /**
- * Convert the current thread to a new ThreadObject.
- * @return A new ThreadObject with the current thread attached to it.
- */
- static ThreadObject *AttachCurrent();
-
- /**
- * Find the Id of the current running thread.
- * @return The thread ID of the current active thread.
- */
- static uint CurrentId();
-};
-
-/**
- * Cross-platform Thread Semaphore. Wait() waits for a Set() of someone else.
- */
-class ThreadSemaphore {
-public:
- static ThreadSemaphore *New();
-
- /**
- * Virtual Destructor to avoid compiler warnings.
- */
- virtual ~ThreadSemaphore() {};
-
- /**
- * Signal all threads that are in Wait() to continue.
- */
- virtual void Set() = 0;
-
- /**
- * Wait until we are signaled by a call to Set().
- */
- virtual void Wait() = 0;
+ static bool New(OTTDThreadFunc proc, void *param, ThreadObject **thread = NULL);
};
#endif /* THREAD_H */