src/thread.h
author celestar
Sun, 11 Mar 2007 09:28:58 +0000
branchcustombridgeheads
changeset 5651 335d9bd345b0
parent 5643 3778051e8095
child 6298 c30fe89622df
child 6573 7624f942237f
permissions -rw-r--r--
(svn r9109) [cbh] -Fix: Stabilize the reversing of trains on bridges/bridgeheads a little (it still crashes at times however). Also re-allow the construction of signals on bridgeheads
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
4298
3417f80deca1 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2380
diff changeset
     6
typedef struct OTTDThread OTTDThread;
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     7
4298
3417f80deca1 (svn r5943) -Merge TGP (part r5725): -Codechange: renamed Thread to OTTDThread, as Windows
truelight
parents: 2380
diff changeset
     8
typedef void* (*OTTDThreadFunc)(void*);
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
OTTDThread* OTTDCreateThread(OTTDThreadFunc, void*);
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    11
void*       OTTDJoinThread(OTTDThread*);
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4298
diff changeset
    12
void        OTTDExitThread(void);
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    13
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
    14
#endif /* THREAD_H */