- Timestamp:
- 2005-04-09T18:22:53Z (21 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8262010
- Parents:
- e6ba9a3f
- Location:
- src/synch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/synch/rwlock.c
re6ba9a3f r43114c5 81 81 82 82 pri = cpu_priority_high(); 83 spinlock_lock(& the->thread->lock);84 the->thread->rwlock_holder_type = RWLOCK_WRITER;85 spinlock_unlock(& the->thread->lock);83 spinlock_lock(&THREAD->lock); 84 THREAD->rwlock_holder_type = RWLOCK_WRITER; 85 spinlock_unlock(&THREAD->lock); 86 86 cpu_priority_restore(pri); 87 87 … … 121 121 122 122 pri = cpu_priority_high(); 123 spinlock_lock(& the->thread->lock);124 the->thread->rwlock_holder_type = RWLOCK_READER;125 spinlock_unlock(& the->thread->lock);123 spinlock_lock(&THREAD->lock); 124 THREAD->rwlock_holder_type = RWLOCK_READER; 125 spinlock_unlock(&THREAD->lock); 126 126 127 127 spinlock_lock(&rwl->lock); -
src/synch/spinlock.c
re6ba9a3f r43114c5 50 50 while (test_and_set(&sl->val)) { 51 51 if (i++ > 300000) { 52 printf("cpu%d: looping on spinlock %X, caller=%X\n", the->cpu->id, sl, caller);52 printf("cpu%d: looping on spinlock %X, caller=%X\n", CPU->id, sl, caller); 53 53 i = 0; 54 54 } -
src/synch/waitq.c
re6ba9a3f r43114c5 130 130 * there are timeouts in progress. 131 131 */ 132 spinlock_lock(& the->thread->lock);133 if ( the->thread->timeout_pending) {134 spinlock_unlock(& the->thread->lock);132 spinlock_lock(&THREAD->lock); 133 if (THREAD->timeout_pending) { 134 spinlock_unlock(&THREAD->lock); 135 135 cpu_priority_restore(pri); 136 136 goto restart; 137 137 } 138 spinlock_unlock(& the->thread->lock);138 spinlock_unlock(&THREAD->lock); 139 139 140 140 spinlock_lock(&wq->lock); … … 160 160 * Now we are firmly decided to go to sleep. 161 161 */ 162 spinlock_lock(& the->thread->lock);162 spinlock_lock(&THREAD->lock); 163 163 if (usec) { 164 164 /* We use the timeout variant. */ 165 if (!context_save(& the->thread->sleep_timeout_context)) {165 if (!context_save(&THREAD->sleep_timeout_context)) { 166 166 /* 167 167 * Short emulation of scheduler() return code. 168 168 */ 169 spinlock_unlock(& the->thread->lock);169 spinlock_unlock(&THREAD->lock); 170 170 cpu_priority_restore(pri); 171 171 return ESYNCH_TIMEOUT; 172 172 } 173 the->thread->timeout_pending = 1;174 timeout_register(& the->thread->sleep_timeout, (__u64) usec, waitq_interrupted_sleep, the->thread);175 } 176 177 list_append(& the->thread->wq_link, &wq->head);173 THREAD->timeout_pending = 1; 174 timeout_register(&THREAD->sleep_timeout, (__u64) usec, waitq_interrupted_sleep, THREAD); 175 } 176 177 list_append(&THREAD->wq_link, &wq->head); 178 178 179 179 /* 180 180 * Suspend execution. 181 181 */ 182 the->thread->state = Sleeping;183 the->thread->sleep_queue = wq;184 185 spinlock_unlock(& the->thread->lock);182 THREAD->state = Sleeping; 183 THREAD->sleep_queue = wq; 184 185 spinlock_unlock(&THREAD->lock); 186 186 187 187 scheduler(); /* wq->lock is released in scheduler_separated_stack() */
Note:
See TracChangeset
for help on using the changeset viewer.
