thread.h
author tron
Sun, 14 Aug 2005 18:10:18 +0000
changeset 2340 e18ef06bc59a
parent 2286 733dbf6b4545
child 2380 392bba57462d
permissions -rw-r--r--
(svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
This doesn't ease the global variable mess, but makes the distinction between sprite heap and gfx loading routines easier.
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
/*
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     7
 * DO NOT USE THREADS if you don't know what race conditions, mutexes,
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     8
 * semaphores, atomic operations, etc. are or how to properly handle them.
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     9
 * Ask somebody who has a clue.
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    10
 */
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    11
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    12
typedef struct Thread Thread;
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    13
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    14
typedef void* (*ThreadFunc)(void*);
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    15
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    16
Thread* OTTDCreateThread(ThreadFunc, void*);
2286
733dbf6b4545 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    17
void*   OTTDJoinThread(Thread*);
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    18
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    19
#endif