Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/openal-0.0.8/src/al_threadlib.h @ 53

Last change on this file since 53 was 17, checked in by landauf, 17 years ago

added openal

File size: 1.1 KB
RevLine 
[17]1/* -*- mode: C; tab-width:8; c-basic-offset:8 -*-
2 * vi:set ts=8:
3 *
4 * al_threadlib.h
5 *
6 * Header which sorts out which thread package we're using.
7 */
8#ifndef THREADLIB_H_
9#define THREADLIB_H_
10
11#include "al_siteconfig.h"
12
13#if defined(USE_POSIXTHREADING)
14
15#include <pthread.h>
16typedef pthread_t *ThreadID;
17
18#elif defined(USE_WINDOWSTHREADING)
19
20#include <windows.h>
21typedef HANDLE ThreadID;
22
23#elif defined(USE_MORPHOSTHREADING)
24
25#include <exec/ports.h>
26#include <dos/dosextens.h>
27
28struct ThreadData {
29        struct Process *td_Thread;
30        struct MsgPort *td_MsgPort;
31};
32
33typedef struct ThreadData *ThreadID;
34
35#else
36
37#error "No thread package"
38
39#endif
40
41/*
42 * Creates a thread, which starts by running fn.
43 */
44extern ThreadID _alCreateThread( int ( *fn ) ( void * ) );
45
46/*
47 * Waits for thread to terminate before returning.
48 */
49extern int _alWaitThread( ThreadID thread );
50
51/*
52 * Returns the identifier for the callee's thread.
53 */
54extern unsigned int _alSelfThread( void );
55
56/*
57 * Forces the callee to terminate.
58 */
59extern void _alExitThread( void ) AL_ATTRIBUTE_NORETURN_;
60
61#endif                          /* THREADLIB_H_ */
Note: See TracBrowser for help on using the repository browser.