1.3 API CHANGE: Add support for naming threads.

--HG--
extra : rebase_source : ae532d4b4d68ef86de0fc2cb6794a622e0841bce
This commit is contained in:
Ryan C. Gordon 2011-10-02 00:29:16 -04:00
parent dead491b27
commit 0863dee582
22 changed files with 183 additions and 45 deletions

View file

@ -1033,12 +1033,14 @@ open_audio_device(const char *devname, int iscapture,
/* Start the audio thread if necessary */
if (!current_audio.impl.ProvidesOwnCallbackThread) {
/* Start the audio thread */
char name[64];
SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) (id + 1));
/* !!! FIXME: this is nasty. */
#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
#undef SDL_CreateThread
device->thread = SDL_CreateThread(SDL_RunAudio, device, NULL, NULL);
device->thread = SDL_CreateThread(SDL_RunAudio, name, device, NULL, NULL);
#else
device->thread = SDL_CreateThread(SDL_RunAudio, device);
device->thread = SDL_CreateThread(SDL_RunAudio, name, device);
#endif
if (device->thread == NULL) {
SDL_CloseAudioDevice(id + 1);