19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* 29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL - Simple DirectMedia Layer 39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Copyright (C) 1997-2012 Sam Lantinga 49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall This library is free software; you can redistribute it and/or 69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modify it under the terms of the GNU Lesser General Public 79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall License as published by the Free Software Foundation; either 89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall version 2.1 of the License, or (at your option) any later version. 99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall This library is distributed in the hope that it will be useful, 119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall but WITHOUT ANY WARRANTY; without even the implied warranty of 129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Lesser General Public License for more details. 149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall You should have received a copy of the GNU Lesser General Public 169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall License along with this library; if not, write to the Free Software 179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Sam Lantinga 209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall slouken@libsdl.org 219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall*/ 229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_config.h" 239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifndef _SDL_thread_c_h 259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _SDL_thread_c_h 269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Need the definitions of SYS_ThreadHandle */ 289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_THREADS_DISABLED 299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "generic/SDL_systhread_c.h" 309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif SDL_THREAD_BEOS 319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "beos/SDL_systhread_c.h" 329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif SDL_THREAD_DC 339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "dc/SDL_systhread_c.h" 349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif SDL_THREAD_OS2 359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "os2/SDL_systhread_c.h" 369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif SDL_THREAD_PTH 379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "pth/SDL_systhread_c.h" 389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif SDL_THREAD_PTHREAD 399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "pthread/SDL_systhread_c.h" 409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif SDL_THREAD_SPROC 419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "irix/SDL_systhread_c.h" 429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif SDL_THREAD_WIN32 439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "win32/SDL_systhread_c.h" 449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#elif SDL_THREAD_SYMBIAN 459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "symbian/SDL_systhread_c.h" 469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#else 479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#error Need thread implementation for this platform 489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "generic/SDL_systhread_c.h" 499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif 509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../SDL_error_c.h" 519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* This is the system-independent thread info structure */ 539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstruct SDL_Thread { 549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Uint32 threadid; 559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SYS_ThreadHandle handle; 569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall int status; 579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_error errbuf; 589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall void *data; 599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}; 609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* This is the function called to run a thread */ 629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallextern void SDL_RunThread(void *data); 639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif /* _SDL_thread_c_h */ 65