thread.h
author truelight
Sun, 29 Jan 2006 22:42:17 +0000
changeset 2927 15690f1a9bb8
parent 2380 3b26659b4a9a
child 4298 3417f80deca1
permissions -rw-r--r--
(svn r3483) -Fix: fixed warning about setjmp (tnx Bjarni for testing, and tnx for
taking the effort to commit it)
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 */