include/SDL_thread.h
changeset 0 74212992fb08
child 251 b8688cfdc232
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_thread.h	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,79 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Library General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Library General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Library General Public
    1.19 +    License along with this library; if not, write to the Free
    1.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@devolution.com
    1.24 +*/
    1.25 +
    1.26 +#ifdef SAVE_RCSID
    1.27 +static char rcsid =
    1.28 + "@(#) $Id$";
    1.29 +#endif
    1.30 +
    1.31 +#ifndef _SDL_thread_h
    1.32 +#define _SDL_thread_h
    1.33 +
    1.34 +/* Header for the SDL thread management routines 
    1.35 +
    1.36 +	These are independent of the other SDL routines.
    1.37 +*/
    1.38 +
    1.39 +#include "SDL_main.h"
    1.40 +#include "SDL_types.h"
    1.41 +
    1.42 +/* Thread synchronization primitives */
    1.43 +#include "SDL_mutex.h"
    1.44 +
    1.45 +#include "begin_code.h"
    1.46 +/* Set up for C function definitions, even when using C++ */
    1.47 +#ifdef __cplusplus
    1.48 +extern "C" {
    1.49 +#endif
    1.50 +
    1.51 +/* The SDL thread structure, defined in SDL_thread.c */
    1.52 +struct SDL_Thread;
    1.53 +typedef struct SDL_Thread SDL_Thread;
    1.54 +
    1.55 +/* Create a thread */
    1.56 +extern DECLSPEC SDL_Thread * SDL_CreateThread(int (*fn)(void *), void *data);
    1.57 +
    1.58 +/* Get the 32-bit thread identifier for the current thread */
    1.59 +extern DECLSPEC Uint32 SDL_ThreadID(void);
    1.60 +
    1.61 +/* Get the 32-bit thread identifier for the specified thread,
    1.62 +   equivalent to SDL_ThreadID() if the specified thread is NULL.
    1.63 + */
    1.64 +extern DECLSPEC Uint32 SDL_GetThreadID(SDL_Thread *thread);
    1.65 +
    1.66 +/* Wait for a thread to finish.
    1.67 +   The return code for the thread function is placed in the area
    1.68 +   pointed to by 'status', if 'status' is not NULL.
    1.69 + */
    1.70 +extern DECLSPEC void SDL_WaitThread(SDL_Thread *thread, int *status);
    1.71 +
    1.72 +/* Forcefully kill a thread without worrying about its state */
    1.73 +extern DECLSPEC void SDL_KillThread(SDL_Thread *thread);
    1.74 +
    1.75 +
    1.76 +/* Ends C function definitions when using C++ */
    1.77 +#ifdef __cplusplus
    1.78 +}
    1.79 +#endif
    1.80 +#include "close_code.h"
    1.81 +
    1.82 +#endif /* _SDL_thread_h */