Added SDL_LinuxSetThreadPriority() to directly set the priority of a Linux thread (tid)

This function tries using RealtimeKit connecting over DBUS as needed.
This commit is contained in:
Sam Lantinga 2018-04-23 19:18:52 -07:00
parent 467b928af2
commit 9a335154f2
4 changed files with 42 additions and 18 deletions

View file

@ -76,6 +76,18 @@ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *a
#endif /* __WIN32__ */
/* Platform specific functions for Linux */
#ifdef __LINUX__
/**
\brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
\return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
#endif /* __LINUX__ */
/* Platform specific functions for iOS */
#if defined(__IPHONEOS__) && __IPHONEOS__