get into sleep and release the lock in an atomic operation

From: Kallol Biswas
Date: Mon Sep 29 2003 - 19:14:26 EST


Consider the few lines of code:

spinlock()

if (num == 0) {
sleep and release the spinlock in an atomic operation.
}

In the OS like HP-UX there was a sleep lock concept, the
code would look like:

get_sleeplock()

if (num== 0) {
sleep and release the lock
}

Is there any primitive that implements this kind of spinlock and
sleep in linux? I could not find it.
I know it can be implemented.


Kallol

-
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/