Skip to content
  • Alessandro Rubini's avatar
    stats: use a sequence number · 9cebdc65
    Alessandro Rubini authored and Grzegorz Daniluk's avatar Grzegorz Daniluk committed
    
    
    If the host wants a consistent view (*if* it wants it), it
    can wait for the sequence number to be even, read the lot and
    then check it did not change.
    
    If it is odd, it means the structure is being modified. If it changed
    after reading it means a new modification started.
    
    Not my invention: it's old stuff, though smart. See sequential locks
    in the kernel for example.
    
    Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
    9cebdc65