src/thread.h
author celestar
Tue, 12 Jun 2007 11:56:35 +0000
branchgamebalance
changeset 9908 0fa543611bbe
parent 9895 7bd07f43b0e3
permissions -rw-r--r--
(svn r10112) [gamebalance] -Sync: r9520:9620 from trunk
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
9908
0fa543611bbe (svn r10112) [gamebalance] -Sync: r9520:9620 from trunk
celestar
parents: 9895
diff changeset
     3
/** @file thread.h */
0fa543611bbe (svn r10112) [gamebalance] -Sync: r9520:9620 from trunk
celestar
parents: 9895
diff changeset
     4
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     5
#ifndef THREAD_H
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     6
#define THREAD_H
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     7
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 5726
diff changeset
     8
struct OTTDThread;
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     9
4298
3417f80deca1 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2380
diff changeset
    10
typedef void* (*OTTDThreadFunc)(void*);
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    11
4298
3417f80deca1 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2380
diff changeset
    12
OTTDThread* OTTDCreateThread(OTTDThreadFunc, void*);
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    13
void*       OTTDJoinThread(OTTDThread*);
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 5726
diff changeset
    14
void        OTTDExitThread();
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    15
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
    16
#endif /* THREAD_H */