Files @ r10525:898f08b99221
Branch filter:

Location: cpp/openttd-patchpack/source/src/thread_os2.cpp

translators
(svn r14782) -Update: WebTranslator2 update to 2009-01-02 18:38:20
arabic_egypt - 7 fixed by khaloofah (7)
brazilian_portuguese - 14 fixed, 5 changed by tucalipe (19)
catalan - 14 fixed by arnaullv (14)
finnish - 14 fixed by jpx_ (14)
hungarian - 14 fixed by alyr (14)
indonesian - 6 changed by fanioz (6)
korean - 13 fixed by dlunch (13)
malay - 8 fixed by tombakemas (8)
serbian - 29 fixed, 2 changed by nummer (31)
thai - 2 fixed by chat9780 (2)
ukrainian - 13 fixed by mad (1), znikoz (12)
urdu - 20 fixed by yasirniazkhan (20)
/* $Id$ */

/** @file thread_os2.cpp OS2 implementation of Threads. */

#include "stdafx.h"
#include "thread.h"

#if 0
#include "debug.h"
#include "core/alloc_func.hpp"
#include <stdlib.h>

#define INCL_DOS
#include <os2.h>
#include <process.h>

struct OTTDThread {
	TID thread;
	OTTDThreadFunc func;
	void *arg;
	void *ret;
};

static void Proxy(void *arg)
{
	OTTDThread *t = (OTTDThread *)arg;
	t->ret = t->func(t->arg);
}

OTTDThread *OTTDCreateThread(OTTDThreadFunc function, void *arg)
{
	OTTDThread *t = MallocT<OTTDThread>(1);

	t->func = function;
	t->arg  = arg;
	t->thread = _beginthread(Proxy, NULL, 32768, t);
	if (t->thread != (TID)-1) {
		return t;
	} else {
		free(t);
		return NULL;
	}
}

void *OTTDJoinThread(OTTDThread *t)
{
	if (t == NULL) return NULL;

	DosWaitThread(&t->thread, DCWW_WAIT);
	void *ret = t->ret;
	free(t);
	return ret;
}

void OTTDExitThread()
{
	_endthread();
}

#endif

/* static */ ThreadObject *ThreadObject::New(OTTDThreadFunc proc, void *param)
{
	return NULL;
}

/* static */ ThreadObject *ThreadObject::AttachCurrent()
{
	return NULL;
}

/* static */ uint ThreadObject::CurrentId()
{
	return -1;
}

/* static */ ThreadSemaphore *ThreadSemaphore::New()
{
	return NULL;
}