Re: ExtAudioFileDispose blocking
Re: ExtAudioFileDispose blocking
- Subject: Re: ExtAudioFileDispose blocking
- From: Ethan Funk <email@hidden>
- Date: Thu, 1 Apr 2010 17:51:28 -0700
I thought I fixed this problem two weeks ago, but it came up again in my code, this time with some debugging hooks still in place from before:
I am playing an audio file using the ExtAudioFile API. I open a file, create a "filler" pthread which then uses ExtAudioFileRead to keep an audio ring buffer full. The ring buffer feeds an AU via a render callback. When it's done playing, a flag (unsigned char - should be atomic) is set in the render callback function to tell the filler thread to exit, pthread_join is used in the main thread to wait for it to exit. Then ExtAudioFileDispose is called. The main thread has started another file playing by now, but I think that is immaterial.
This works great for days... then, a file comes up (could be any file, not one in particular), where the filler thread disappears after being created. From some logging code I added, I can see that the thread started, but never exited, it just disappeared. It doesn't show up in the debugger either. Then, when the code go to clean up the file player, it pthread_joins the filler thread with no problem, then hangs on ExtAudioFileDispose. It looks to me like the filler thread "crashed" on ExtAudioFileRead, whith some ExtAudioFile API lock was in place, making ExtAudioFileDispose block. But why? Where oh where has my pthread gone? No console errors. No signals.
Any ideas?
Ethan...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden