thread.c
author peter1138
Mon, 23 Oct 2006 18:45:43 +0000
changeset 4930 708801d486c6
parent 4324 9682c016b892
permissions -rw-r--r--
(svn r6910) - Codechange: Supply width of area when drawing purchase info instead of using hardcoded values. (mart3p)
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     1
/* $Id$ */
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     2
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     3
#include "stdafx.h"
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     4
#include "thread.h"
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     5
#include <stdlib.h>
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     6
4324
9682c016b892 (svn r5978) -Add: allow a switch in Makefile.config to disable threads in OpenTTD (no matter what system you are on). Only useful for testing.
truelight
parents: 4300
diff changeset
     7
#if defined(__AMIGA__) || defined(__MORPHOS__) || defined(NO_THREADS)
9682c016b892 (svn r5978) -Add: allow a switch in Makefile.config to disable threads in OpenTTD (no matter what system you are on). Only useful for testing.
truelight
parents: 4300
diff changeset
     8
OTTDThread *OTTDCreateThread(OTTDThreadFunc function, void *arg) { return NULL; }
9682c016b892 (svn r5978) -Add: allow a switch in Makefile.config to disable threads in OpenTTD (no matter what system you are on). Only useful for testing.
truelight
parents: 4300
diff changeset
     9
void *OTTDJoinThread(OTTDThread *t) { return NULL; }
9682c016b892 (svn r5978) -Add: allow a switch in Makefile.config to disable threads in OpenTTD (no matter what system you are on). Only useful for testing.
truelight
parents: 4300
diff changeset
    10
void OTTDExitThread(void) { NOT_REACHED(); };
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    11
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    12
#elif defined(__OS2__)
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    13
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    14
#define INCL_DOS
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    15
#include <os2.h>
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    16
#include <process.h>
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    17
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    18
struct OTTDThread {
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    19
	TID thread;
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    20
	OTTDThreadFunc func;
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    21
	void* arg;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    22
	void* ret;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    23
};
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    24
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    25
static void Proxy(void* arg)
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    26
{
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    27
	OTTDThread* t = arg;
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    28
	t->ret = t->func(t->arg);
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    29
}
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    30
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    31
OTTDThread* OTTDCreateThread(OTTDThreadFunc function, void* arg)
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    32
{
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    33
	OTTDThread* t = malloc(sizeof(*t));
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    34
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    35
	if (t == NULL) return NULL;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    36
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    37
	t->func = function;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    38
	t->arg  = arg;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    39
	t->thread = _beginthread(Proxy, NULL, 32768, t);
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    40
	if (t->thread != -1) {
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    41
		return t;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    42
	} else {
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    43
		free(t);
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    44
		return NULL;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    45
	}
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    46
}
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    47
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    48
void* OTTDJoinThread(OTTDThread* t)
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    49
{
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    50
	void* ret;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    51
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    52
	if (t == NULL) return NULL;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    53
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    54
	DosWaitThread(&t->thread, DCWW_WAIT);
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    55
	ret = t->ret;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    56
	free(t);
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    57
	return ret;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    58
}
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    59
4300
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    60
void OTTDExitThread(void)
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    61
{
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    62
	_endthread();
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    63
}
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    64
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    65
#elif defined(UNIX)
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    66
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    67
#include <pthread.h>
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    68
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    69
struct OTTDThread {
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    70
	pthread_t thread;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    71
};
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    72
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    73
OTTDThread* OTTDCreateThread(OTTDThreadFunc function, void* arg)
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    74
{
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    75
	OTTDThread* t = malloc(sizeof(*t));
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    76
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    77
	if (t == NULL) return NULL;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    78
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    79
	if (pthread_create(&t->thread, NULL, function, arg) == 0) {
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    80
		return t;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    81
	} else {
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    82
		free(t);
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    83
		return NULL;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    84
	}
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    85
}
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    86
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
    87
void* OTTDJoinThread(OTTDThread* t)
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    88
{
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    89
	void* ret;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    90
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    91
	if (t == NULL) return NULL;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    92
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    93
	pthread_join(t->thread, &ret);
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    94
	free(t);
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    95
	return ret;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    96
}
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    97
4300
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    98
void OTTDExitThread(void)
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    99
{
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
   100
	pthread_exit(NULL);
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
   101
}
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   102
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   103
#elif defined(WIN32)
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   104
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   105
#include <windows.h>
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   106
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
   107
struct OTTDThread {
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   108
	HANDLE thread;
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
   109
	OTTDThreadFunc func;
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   110
	void* arg;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   111
	void* ret;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   112
};
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   113
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   114
static DWORD WINAPI Proxy(LPVOID arg)
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   115
{
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
   116
	OTTDThread* t = arg;
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   117
	t->ret = t->func(t->arg);
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   118
	return 0;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   119
}
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   120
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
   121
OTTDThread* OTTDCreateThread(OTTDThreadFunc function, void* arg)
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   122
{
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
   123
	OTTDThread* t = malloc(sizeof(*t));
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   124
	DWORD dwThreadId;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   125
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   126
	if (t == NULL) return NULL;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   127
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   128
	t->func = function;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   129
	t->arg  = arg;
2287
3e541bce2410 (svn r2811) Fix typos in r2810
tron
parents: 2286
diff changeset
   130
	t->thread = CreateThread(NULL, 0, Proxy, t, 0, &dwThreadId);
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   131
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   132
	if (t->thread != NULL) {
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   133
		return t;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   134
	} else {
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   135
		free(t);
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   136
		return NULL;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   137
	}
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   138
}
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   139
4298
b926a6eaaa70 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2290
diff changeset
   140
void* OTTDJoinThread(OTTDThread* t)
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   141
{
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   142
	void* ret;
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   143
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   144
	if (t == NULL) return NULL;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   145
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   146
	WaitForSingleObject(t->thread, INFINITE);
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   147
	CloseHandle(t->thread);
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   148
	ret = t->ret;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   149
	free(t);
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
   150
	return ret;
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   151
}
4300
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
   152
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
   153
void OTTDExitThread(void)
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
   154
{
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
   155
	ExitThread(0);
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
   156
}
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
   157
#endif