[vlc-devel] [vlc-commits] picture_pool: fix race condition

Rémi Denis-Courmont remi at remlab.net
Fri Oct 31 11:47:36 CET 2014


Le 2014-10-31 13:40, Thomas Guillem a écrit :
> I don't understand well that part of the code, so I trust you and 
> your
> code.

But there is nothing to understand... The semantics of the function are 
unchanged!

Literally, the change replaces this pseudocode:

if (refs > 0) /* atomic_load */
     continue;
refs += 1; /* picture_Hold() */

with equivalent but actually atomic pseudocode:

if (refs != 0)
     continue;
refs = 1;

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list