author | Darkvater |
Sun, 29 Jan 2006 18:57:26 +0000 | |
changeset 2916 | 8f1aa489701f |
parent 2380 | 3b26659b4a9a |
child 4298 | 3417f80deca1 |
permissions | -rw-r--r-- |
2285
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
1 |
/* $Id$ */ |
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
2 |
|
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
3 |
#ifndef THREAD_H |
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
4 |
#define THREAD_H |
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
5 |
|
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
6 |
typedef struct Thread Thread; |
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
7 |
|
2286
acb76b379e72
(svn r2810) Threads may now return information when they terminate using a void*.
tron
parents:
2285
diff
changeset
|
8 |
typedef void* (*ThreadFunc)(void*); |
2285
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
9 |
|
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
10 |
Thread* OTTDCreateThread(ThreadFunc, void*); |
2286
acb76b379e72
(svn r2810) Threads may now return information when they terminate using a void*.
tron
parents:
2285
diff
changeset
|
11 |
void* OTTDJoinThread(Thread*); |
2285
3193cbd1ba88
(svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff
changeset
|
12 |
|
2380
3b26659b4a9a
(svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop.
Darkvater
parents:
2286
diff
changeset
|
13 |
#endif /* THREAD_H */ |