comparison include/SDL_thread.h @ 4866:f42e8db53f78

Added a typedef for the thread function to simplify documentation
author Sam Lantinga <slouken@libsdl.org>
date Sat, 28 Aug 2010 22:56:52 -0700
parents 82f357a91d43
children e8916fe9cfc8
comparison
equal deleted inserted replaced
4865:fff50e86c891 4866:f42e8db53f78
48 typedef struct SDL_Thread SDL_Thread; 48 typedef struct SDL_Thread SDL_Thread;
49 49
50 /* The SDL thread ID */ 50 /* The SDL thread ID */
51 typedef unsigned long SDL_threadID; 51 typedef unsigned long SDL_threadID;
52 52
53 /* The function passed to SDL_CreateThread()
54 It is passed a void* user context parameter and returns an int.
55 */
56 typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
57
53 #if defined(__WIN32__) && !defined(HAVE_LIBC) 58 #if defined(__WIN32__) && !defined(HAVE_LIBC)
54 /** 59 /**
55 * \file SDL_thread.h 60 * \file SDL_thread.h
56 * 61 *
57 * We compile SDL into a DLL. This means, that it's the DLL which 62 * We compile SDL into a DLL. This means, that it's the DLL which
98 103
99 /** 104 /**
100 * Create a thread. 105 * Create a thread.
101 */ 106 */
102 extern DECLSPEC SDL_Thread *SDLCALL 107 extern DECLSPEC SDL_Thread *SDLCALL
103 SDL_CreateThread(int (SDLCALL * f) (void *), void *data, 108 SDL_CreateThread(SDL_ThreadFunction fn, void *data,
104 pfnSDL_CurrentBeginThread pfnBeginThread, 109 pfnSDL_CurrentBeginThread pfnBeginThread,
105 pfnSDL_CurrentEndThread pfnEndThread); 110 pfnSDL_CurrentEndThread pfnEndThread);
106 111
107 #if defined(_WIN32_WCE) 112 #if defined(_WIN32_WCE)
108 113
123 128
124 /** 129 /**
125 * Create a thread. 130 * Create a thread.
126 */ 131 */
127 extern DECLSPEC SDL_Thread *SDLCALL 132 extern DECLSPEC SDL_Thread *SDLCALL
128 SDL_CreateThread(int (SDLCALL * fn) (void *), void *data); 133 SDL_CreateThread(SDL_ThreadFunction fn, void *data);
129 134
130 #endif 135 #endif
131 136
132 /** 137 /**
133 * Get the thread identifier for the current thread. 138 * Get the thread identifier for the current thread.