Skip to contentSkip to conversation

get into sleep and release the lock in an atomic operation

DISCUSSION Kallol Biswas 1 participant 1 message Sep 30, 2003

lore
Share & tools
lore
#0 lore raw

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