Skip to contentSkip to conversation

spinlock & atomic

OFFTOPIC & trivial FabF 1 participant 1 message May 13, 2004

lore
Share & tools
lore

FabF

author
#0 lore raw

Hi,

Someone could explain why we have following code in kernel ?

spinlock (x)
atomic_inc (x->y)
spinunlock(x)

I mean y being part of x should be atomically modified with a "normal"
operation ? What am I missing ? Does it mean we defined y atomic_t in order to have atomic operations elsewhere without the lock held ? Simply ?

Regards,
FabF