Files @ r10673:d53513e30781
Branch filter:

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

translators
(svn r14977) -Update: WebTranslator2 update to 2009-01-10 18:44:17
arabic_egypt - 4 fixed by khaloofah (4)
brazilian_portuguese - 26 fixed by tucalipe (26)
bulgarian - 3 fixed by Ar4i (3)
catalan - 3 fixed by arnaullv (3)
croatian - 35 fixed by tifached (35)
czech - 52 fixed, 10 changed by Hadez (62)
danish - 4 fixed by ThomasA (4)
dutch - 6 fixed by Excel20 (4), habell (2)
finnish - 15 fixed by UltimateSephiroth (15)
french - 15 fixed by glx (15)
hungarian - 6 fixed by alyr (6)
indonesian - 6 fixed, 64 changed by fanioz (70)
italian - 3 fixed, 1 changed by lorenzodv (4)
portuguese - 6 fixed by rmrebelo (6)
romanian - 6 fixed by kkmic (6)
/* $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;
}