SDL_systhread.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include "SDL_config.h"
  19. /* These are functions that need to be implemented by a port of SDL */
  20. #ifndef _SDL_systhread_h
  21. #define _SDL_systhread_h
  22. #include "SDL_thread.h"
  23. #include "SDL_thread_c.h"
  24. /* This function creates a thread, passing args to SDL_RunThread(),
  25. saves a system-dependent thread id in thread->id, and returns 0
  26. on success.
  27. */
  28. #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
  29. extern int SDL_SYS_CreateThread(SDL_Thread * thread, void *args,
  30. pfnSDL_CurrentBeginThread pfnBeginThread,
  31. pfnSDL_CurrentEndThread pfnEndThread);
  32. #else
  33. extern int SDL_SYS_CreateThread(SDL_Thread * thread, void *args);
  34. #endif
  35. /* This function does any necessary setup in the child thread */
  36. extern void SDL_SYS_SetupThread(const char *name);
  37. /* This function sets the current thread priority */
  38. extern int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority);
  39. /* This function waits for the thread to finish and frees any data
  40. allocated by SDL_SYS_CreateThread()
  41. */
  42. extern void SDL_SYS_WaitThread(SDL_Thread * thread);
  43. /* Get the thread local storage for this thread */
  44. extern SDL_TLSData *SDL_SYS_GetTLSData();
  45. /* Set the thread local storage for this thread */
  46. extern int SDL_SYS_SetTLSData(SDL_TLSData *data);
  47. #endif /* _SDL_systhread_h */
  48. /* vi: set ts=4 sw=4 expandtab: */