Changeset - r1911:d38e1a68e999
[Not reviewed]
master
0 2 0
Darkvater - 19 years ago 2005-06-06 12:11:44
darkvater@openttd.org
(svn r2417) - Fix: threads on morphos are apparently unexistent, so implement stubs for them (tokai)
2 files changed with 13 insertions and 2 deletions:
unix.c
12
1
win32.c
1
1
0 comments (0 inline, 0 general)
unix.c
Show inline comments
 
@@ -8,13 +8,15 @@
 
#include <dirent.h>
 
#include <unistd.h>
 
#include <sys/stat.h>
 
#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
 
#endif
 

	
 
#ifdef HAS_STATVFS
 
@@ -553,13 +555,22 @@ void DeterminePaths(void)
 

	
 
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;
 
}
 

	
 
void CloseOTTDThread(void) {return;}
win32.c
Show inline comments
 
@@ -2246,13 +2246,13 @@ bool InsertTextBufferClipboard(Textbuf *
 
static HANDLE hThread;
 

	
 
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;
 
}
 

	
 
void CloseOTTDThread(void)
 
{
0 comments (0 inline, 0 general)