thread.h
author bjarni
Sat, 03 Dec 2005 13:43:54 +0000
changeset 2712 f0b9526767d3
parent 2380 392bba57462d
child 4298 b926a6eaaa70
permissions -rw-r--r--
(svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
it caused way more problems than it solved
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 */