Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1579 → Rev 1580

/kernel/trunk/generic/src/synch/waitq.c
311,14 → 311,19
*/
spinlock_lock(&THREAD->lock);
 
if (THREAD->interrupted) {
spinlock_unlock(&THREAD->lock);
spinlock_unlock(&wq->lock);
return ESYNCH_INTERRUPTED;
}
if (flags & SYNCH_FLAGS_INTERRUPTIBLE) {
 
if (flags & SYNCH_FLAGS_INTERRUPTIBLE) {
/*
* If the thread was already interrupted,
* don't go to sleep at all.
*/
if (THREAD->interrupted) {
spinlock_unlock(&THREAD->lock);
spinlock_unlock(&wq->lock);
return ESYNCH_INTERRUPTED;
}
 
/*
* Set context that will be restored if the sleep
* of this thread is ever interrupted.
*/
328,6 → 333,7
spinlock_unlock(&THREAD->lock);
return ESYNCH_INTERRUPTED;
}
 
} else {
THREAD->sleep_interruptible = false;
}