Changeset 22f7769 in mainline for src/synch/waitq.c
- Timestamp:
- 2005-10-17T23:31:41Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4b2c872d
- Parents:
- 75eacab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/synch/waitq.c
r75eacab r22f7769 138 138 int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int nonblocking) 139 139 { 140 volatile pri_t pri; /* must be live after context_restore() */140 volatile ipl_t ipl; /* must be live after context_restore() */ 141 141 142 142 143 143 restart: 144 pri = cpu_priority_high();144 ipl = interrupts_disable(); 145 145 146 146 /* … … 154 154 if (THREAD->timeout_pending) { 155 155 spinlock_unlock(&THREAD->lock); 156 cpu_priority_restore(pri);156 interrupts_restore(ipl); 157 157 goto restart; 158 158 } … … 165 165 wq->missed_wakeups--; 166 166 spinlock_unlock(&wq->lock); 167 cpu_priority_restore(pri);167 interrupts_restore(ipl); 168 168 return ESYNCH_OK_ATOMIC; 169 169 } … … 172 172 /* return immediatelly instead of going to sleep */ 173 173 spinlock_unlock(&wq->lock); 174 cpu_priority_restore(pri);174 interrupts_restore(ipl); 175 175 return ESYNCH_WOULD_BLOCK; 176 176 } … … 190 190 before_thread_runs(); 191 191 spinlock_unlock(&THREAD->lock); 192 cpu_priority_restore(pri);192 interrupts_restore(ipl); 193 193 return ESYNCH_TIMEOUT; 194 194 } … … 208 208 209 209 scheduler(); /* wq->lock is released in scheduler_separated_stack() */ 210 cpu_priority_restore(pri);210 interrupts_restore(ipl); 211 211 212 212 return ESYNCH_OK_BLOCKED; … … 229 229 void waitq_wakeup(waitq_t *wq, int all) 230 230 { 231 pri_t pri;232 233 pri = cpu_priority_high();231 ipl_t ipl; 232 233 ipl = interrupts_disable(); 234 234 spinlock_lock(&wq->lock); 235 235 … … 237 237 238 238 spinlock_unlock(&wq->lock); 239 cpu_priority_restore(pri);239 interrupts_restore(ipl); 240 240 } 241 241
Note:
See TracChangeset
for help on using the changeset viewer.