mirror of
https://git.openafs.org/openafs.git
synced 2025-01-22 08:50:17 +00:00
Block all signals while sleeping; this prevents 100% cpu usage
when a process waiting for an afs operation to complete receives a signal.
This commit is contained in:
parent
905b71014b
commit
41fb11e6b2
@ -223,9 +223,22 @@ void afs_osi_Sleep(char *event)
|
||||
seq = evp->seq;
|
||||
|
||||
while (seq == evp->seq) {
|
||||
sigset_t saved_set;
|
||||
|
||||
AFS_ASSERT_GLOCK();
|
||||
AFS_GUNLOCK();
|
||||
spin_lock_irq(¤t->sigmask_lock);
|
||||
saved_set = current->blocked;
|
||||
sigfillset(¤t->blocked);
|
||||
recalc_sigpending(current);
|
||||
spin_unlock_irq(¤t->sigmask_lock);
|
||||
|
||||
interruptible_sleep_on(&evp->cond);
|
||||
|
||||
spin_lock_irq(¤t->sigmask_lock);
|
||||
current->blocked = saved_set;
|
||||
recalc_sigpending(current);
|
||||
spin_unlock_irq(¤t->sigmask_lock);
|
||||
AFS_GLOCK();
|
||||
}
|
||||
relevent(evp);
|
||||
|
Loading…
Reference in New Issue
Block a user