[vlc-devel] [PATCH 2/9] video_output: simplify the locking of the display in vout_UpdateWindowSizeLocked

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 11 08:50:27 CEST 2019


On 2019-10-10 18:26, Rémi Denis-Courmont wrote:
> Le torstaina 10. lokakuuta 2019, 18.32.34 EEST Thomas Guillem a écrit :
>> It is just a question of taste. The actual code is OK to me.
>>
>> When I develop, I tend to do like this current code instead of creating an
>> extra variable.
>>
>> I have nothing about this way or another but I don't think this commit is
>> really needed.
> 
> I dislike both ways, but I can't really think of a third option.

I prefer balanced locks. It's easier to read and less prone to mistakes. 
In a small function like that it's easy to spot, but if it even grows 
we're getting closer and closer to a possible issue.

If there we kept the old value we used, we could tell if we really need 
to send the message and save the extra bool (but then we need 2 
unsigned). It may make sense to avoid sending unnecessary messages to 
the window anyway.


More information about the vlc-devel mailing list