[alsa-devel] Alsa-lib 'cancelability'

Alan Horstmann gineera at aspect135.co.uk
Thu Aug 25 21:31:17 CEST 2016


Hi Clemens,

I missed replying to say thanks for the quick response - appreciated.

On Monday 22 August 2016 18:37, you wrote:
> Alan Horstmann wrote:
> > I am wondering if there is a policy on the thread 'cancelability' /
> > 'cancellability' of the functions in Alsa-lib?
>
> Yes.  The policy is "don't even think about it".

Too late - it's been happening for years!

> > The callback runs in it's own thread; when a user requests 'AbortStream'
> > a thread cancel is requested.
>
> Alsa-lib is not the only library with this 'policy'.  You cannot cancel
> threads over whose code you do not have complete control.

I was unsure whether libraries might disable cancelablility themselves as a 
defensive measure so as to protect the internal states - in this case to 
prevent the audio system from getting 'screwed-up', if only for other users.

We will have to ensure there is only limited opportunity for cancelling the 
thread during well-chosen sections.  Initial patches to do just that are 
proving effective.

Thanks again,

Alan


More information about the Alsa-devel mailing list