The API sets the priority for the current thread, not an arbitrary thread.

Implemented thread priority as the 'nice' value on Linux.  High priority threads require root permissions (you shouldn't give your game root permissions though!)
This commit is contained in:
Sam Lantinga 2011-03-25 12:44:06 -07:00
parent fb417a9de4
commit f0b1c9b859
9 changed files with 51 additions and 28 deletions

View file

@ -329,6 +329,9 @@ SDL_RunAudio(void *devicep)
int silence;
Uint32 delay;
/* The audio mixing is always a high priority thread */
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
/* For streaming when the buffer sizes don't match up */
Uint8 *istream;
int istream_len = 0;
@ -974,7 +977,6 @@ open_audio_device(const char *devname, int iscapture,
SDL_SetError("Couldn't create audio thread");
return 0;
}
SDL_SetThreadPriority(device->thread, SDL_THREAD_PRIORITY_HIGH);
}
return id + 1;