Rev 1375 | Rev 1502 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1375 | Rev 1467 | ||
---|---|---|---|
Line 222... | Line 222... | ||
222 | ipl_t ipl; |
222 | ipl_t ipl; |
223 | 223 | ||
224 | restart: |
224 | restart: |
225 | ipl = interrupts_disable(); |
225 | ipl = interrupts_disable(); |
226 | 226 | ||
- | 227 | if (THREAD) { /* needed during system initiailzation */ |
|
227 | /* |
228 | /* |
228 | * Busy waiting for a delayed timeout. |
229 | * Busy waiting for a delayed timeout. |
229 | * This is an important fix for the race condition between |
230 | * This is an important fix for the race condition between |
230 | * a delayed timeout and a next call to waitq_sleep_timeout(). |
231 | * a delayed timeout and a next call to waitq_sleep_timeout(). |
231 | * Simply, the thread is not allowed to go to sleep if |
232 | * Simply, the thread is not allowed to go to sleep if |
Line 236... | Line 237... | ||
236 | spinlock_unlock(&THREAD->lock); |
237 | spinlock_unlock(&THREAD->lock); |
237 | interrupts_restore(ipl); |
238 | interrupts_restore(ipl); |
238 | goto restart; |
239 | goto restart; |
239 | } |
240 | } |
240 | spinlock_unlock(&THREAD->lock); |
241 | spinlock_unlock(&THREAD->lock); |
- | 242 | } |
|
241 | 243 | ||
242 | spinlock_lock(&wq->lock); |
244 | spinlock_lock(&wq->lock); |
243 | return ipl; |
245 | return ipl; |
244 | } |
246 | } |
245 | 247 |