[ OFFTOPIC & trivial ] spinlock & atomic

From: FabF
Date: Thu May 13 2004 - 16:29:19 EST


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/