Re: pcm write from posix threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Tue, 19 Aug 2008 17:24:06 -0500,
Brian Rhodes wrote:
> 
> When calling snd_pcm_write* from a thread how do you safely cancel the 
> thread?  I've tried masking the signals which are used in alsa lib, yet 
> I am getting a segfault on pthread_exit().  My thread is looping doing 
> the following.
> 
> testcancel
> snd_pcm_wait
> snd_pcm_avail
> snd_pcm_writei
> 
> I am checking return values to handle those functions being woken up by 
> pthread cancel and attempting to exit.  In testing the process it 
> performs fine until I start actually writing data.  Once I write some 
> data, a pthread_exit will segfault.  My cancellation routine is calling 
> snd_pcm_drop, then doing a cancel followed by join.

No, alsa-lib functions don't care threads in general.
Some codes have uses pthread_mutex, but not in the PCM core code, at
least.

You need to handle and protect threads by yourself.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux