Ok, that makes sense. 

Can you explain why you think it's better to return EBUSY rather than
blocking on the mutex in -destroy, instead of relying on the user checking the
return code?


> On 17 Mar 2016, at 08:05, Paul Irofti <[email protected]> wrote:
> 
> On Wed, Mar 16, 2016 at 10:16:45PM +0000, Kári Tristan Helgason wrote:
>> This is very similar to the patch I had come up with for this issue.
>> 
>> What is the reason for not using the local variable b in the trylock
>> in barrier_destroy()?
> 
> I want that assignment to happen once we are holding the lock and we're
> sure *barrier is valid. Otherwise another thread could clear it between
> the copy and the mutex lock.

Reply via email to