thread.h
author tron
Fri, 05 Aug 2005 20:18:08 +0000
changeset 2287 2e556bae5fbb
parent 2286 acb76b379e72
child 2380 3b26659b4a9a
permissions -rw-r--r--
(svn r2811) Fix typos in r2810
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
/*
3193cbd1ba88 (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,
3193cbd1ba88 (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.
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
     9
 * Ask somebody who has a clue.
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    10
 */
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    11
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    12
typedef struct Thread Thread;
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    13
2286
acb76b379e72 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    14
typedef void* (*ThreadFunc)(void*);
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    15
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    16
Thread* OTTDCreateThread(ThreadFunc, void*);
2286
acb76b379e72 (svn r2810) Threads may now return information when they terminate using a void*.
tron
parents: 2285
diff changeset
    17
void*   OTTDJoinThread(Thread*);
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    18
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents:
diff changeset
    19
#endif