SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401938
This commit is contained in:
parent
91a32b77a2
commit
0f030a1802
686 changed files with 117556 additions and 98661 deletions
|
@ -23,10 +23,11 @@
|
|||
#ifndef _SDL_thread_h
|
||||
#define _SDL_thread_h
|
||||
|
||||
/* Header for the SDL thread management routines
|
||||
|
||||
These are independent of the other SDL routines.
|
||||
*/
|
||||
/**
|
||||
* \file SDL_thread.h
|
||||
*
|
||||
* Header for the SDL thread management routines
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
@ -37,7 +38,9 @@
|
|||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* The SDL thread structure, defined in SDL_thread.c */
|
||||
|
@ -61,25 +64,39 @@ typedef struct SDL_Thread SDL_Thread;
|
|||
*/
|
||||
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
||||
#ifndef _WIN32_WCE
|
||||
#include <process.h> /* This has _beginthread() and _endthread() defined! */
|
||||
#include <process.h> /* This has _beginthread() and _endthread() defined! */
|
||||
#endif
|
||||
|
||||
#ifdef __OS2__
|
||||
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
|
||||
typedef void (*pfnSDL_CurrentEndThread)(void);
|
||||
typedef int (*pfnSDL_CurrentBeginThread) (void (*func) (void *), void *,
|
||||
unsigned, void *arg);
|
||||
typedef void (*pfnSDL_CurrentEndThread) (void);
|
||||
#elif __GNUC__
|
||||
typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned (__stdcall *func)(void *), void *arg,
|
||||
unsigned, unsigned *threadID);
|
||||
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
|
||||
typedef unsigned long (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned
|
||||
(__stdcall *
|
||||
func) (void *),
|
||||
void *arg,
|
||||
unsigned,
|
||||
unsigned
|
||||
*threadID);
|
||||
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
||||
#else
|
||||
typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned (__stdcall *func)(void *), void *arg,
|
||||
unsigned, unsigned *threadID);
|
||||
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
|
||||
typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned (__stdcall *
|
||||
func) (void
|
||||
*),
|
||||
void *arg, unsigned,
|
||||
unsigned *threadID);
|
||||
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
||||
#endif
|
||||
|
||||
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
|
||||
extern DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int (*fn) (void *),
|
||||
void *data,
|
||||
pfnSDL_CurrentBeginThread
|
||||
pfnBeginThread,
|
||||
pfnSDL_CurrentEndThread
|
||||
pfnEndThread);
|
||||
|
||||
#ifdef __OS2__
|
||||
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
|
||||
|
@ -89,7 +106,8 @@ extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *),
|
|||
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
|
||||
#endif
|
||||
#else
|
||||
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
|
||||
extern DECLSPEC SDL_Thread *SDLCALL
|
||||
SDL_CreateThread(int (SDLCALL * fn) (void *), void *data);
|
||||
#endif
|
||||
|
||||
/* Get the 32-bit thread identifier for the current thread */
|
||||
|
@ -98,22 +116,26 @@ extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
|
|||
/* Get the 32-bit thread identifier for the specified thread,
|
||||
equivalent to SDL_ThreadID() if the specified thread is NULL.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
||||
|
||||
/* Wait for a thread to finish.
|
||||
The return code for the thread function is placed in the area
|
||||
pointed to by 'status', if 'status' is not NULL.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
|
||||
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
|
||||
|
||||
/* Forcefully kill a thread without worrying about its state */
|
||||
extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
|
||||
extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread * thread);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_thread_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue