Rev 2310 | Rev 2451 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2310 | Rev 2446 | ||
---|---|---|---|
Line 403... | Line 403... | ||
403 | if (!spinlock_trylock(&THREAD->join_wq.lock)) { |
403 | if (!spinlock_trylock(&THREAD->join_wq.lock)) { |
404 | /* |
404 | /* |
405 | * Avoid deadlock. |
405 | * Avoid deadlock. |
406 | */ |
406 | */ |
407 | spinlock_unlock(&THREAD->lock); |
407 | spinlock_unlock(&THREAD->lock); |
408 | delay(10); |
408 | delay(HZ); |
409 | spinlock_lock(&THREAD->lock); |
409 | spinlock_lock(&THREAD->lock); |
410 | DEADLOCK_PROBE(p_joinwq, |
410 | DEADLOCK_PROBE(p_joinwq, |
411 | DEADLOCK_THRESHOLD); |
411 | DEADLOCK_THRESHOLD); |
412 | goto repeat; |
412 | goto repeat; |
413 | } |
413 | } |
414 | _waitq_wakeup_unsafe(&THREAD->join_wq, |
414 | _waitq_wakeup_unsafe(&THREAD->join_wq, |
415 | WAKEUP_FIRST); |
415 | WAKEUP_FIRST); |
416 | spinlock_unlock(&THREAD->join_wq.lock); |
416 | spinlock_unlock(&THREAD->join_wq.lock); |
417 | 417 | ||
418 | THREAD->state = Undead; |
418 | THREAD->state = JoinMe; |
419 | spinlock_unlock(&THREAD->lock); |
419 | spinlock_unlock(&THREAD->lock); |
420 | } |
420 | } |
421 | break; |
421 | break; |
422 | 422 | ||
423 | case Sleeping: |
423 | case Sleeping: |