thread.h
author tron
Sun, 21 May 2006 13:51:36 +0000
changeset 3884 793081f80381
parent 2380 392bba57462d
child 4298 b926a6eaaa70
permissions -rw-r--r--
(svn r4940) Remove the dubious feature of remembering the last built depot. It serves no real purpose except causing confusion
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
#ifndef THREAD_H
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     4
#define THREAD_H
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     5
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     6
typedef struct Thread Thread;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     7
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
     8
typedef void* (*ThreadFunc)(void*);
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     9
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    10
Thread* OTTDCreateThread(ThreadFunc, void*);
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    11
void*   OTTDJoinThread(Thread*);
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    12
2380
392bba57462d (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 */