2003-09-30 00:13:35

by Kallol Biswas

[permalink] [raw]
Subject: get into sleep and release the lock in an atomic operation

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