summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-06-06 12:11:44 +0000
committerDarkvater <darkvater@openttd.org>2005-06-06 12:11:44 +0000
commit2bcb41293f276c80d75312b2111d26218624b8e8 (patch)
treeff21fe985ed52074b0ce6dcc0af3169170383091
parent7992e105f900b4cd671bfa6e7e415f5436d563c5 (diff)
downloadopenttd-2bcb41293f276c80d75312b2111d26218624b8e8.tar.xz
(svn r2417) - Fix: threads on morphos are apparently unexistent, so implement stubs for them (tokai)
-rw-r--r--unix.c13
-rw-r--r--win32.c2
2 files changed, 13 insertions, 2 deletions
diff --git a/unix.c b/unix.c
index 84c3365b7..1bc30f3eb 100644
--- a/unix.c
+++ b/unix.c
@@ -11,7 +11,9 @@
#include <time.h>
#include <pwd.h>
#include <signal.h>
-#include <pthread.h>
+#if !defined(__MORPHOS__) && !defined(__AMIGA__)
+ #include <pthread.h>
+#endif
#if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) || defined(__GLIBC__)
#define HAS_STATVFS
@@ -556,7 +558,16 @@ bool InsertTextBufferClipboard(Textbuf *tb)
return false;
}
+/** Dummy stubs as MorphOS/ AmigaOS does not really
+ * know about a thread concept nor has a working libpthread */
+#if defined(__MORPHOS__) || defined(__AMIGA__)
+ typedef int pthread_t;
+ #define pthread_create(thread, attr, function, arg) (true)
+ #define pthread_join(thread, retval) ()
+#endif
+
static pthread_t thread1 = 0;
+
bool CreateOTTDThread(void *func, void *param)
{
return pthread_create(&thread1, NULL, func, param) == 0;
diff --git a/win32.c b/win32.c
index 712dd54b4..3a09b176e 100644
--- a/win32.c
+++ b/win32.c
@@ -2249,7 +2249,7 @@ bool CreateOTTDThread(void *func, void *param)
{
DWORD dwThreadId;
hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func, param, 0, &dwThreadId);
- SetThreadPriority(hThread, THREAD_PRIORITY_BELOW_NORMAL);
+ SetThreadPriority(hThread, THREAD_PRIORITY_NORMAL);
return hThread != NULL;
}