Changeset 6f4495f5 in mainline for kernel/generic/src/synch/rwlock.c
- Timestamp:
- 2007-01-27T17:32:13Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ba41c5
- Parents:
- 51baa8a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/rwlock.c
r51baa8a r6f4495f5 221 221 case ESYNCH_OK_BLOCKED: 222 222 /* 223 * We were woken with rwl->readers_in already incremented. 224 * Note that this arrangement avoids race condition between 225 * two concurrent readers. (Race is avoided if 'exclusive' is 226 * locked at the same time as 'readers_in' is incremented. 227 * Same time means both events happen atomically when 228 * rwl->lock is held.) 223 * We were woken with rwl->readers_in already 224 * incremented. 225 * 226 * Note that this arrangement avoids race condition 227 * between two concurrent readers. (Race is avoided if 228 * 'exclusive' is locked at the same time as 229 * 'readers_in' is incremented. Same time means both 230 * events happen atomically when rwl->lock is held.) 229 231 */ 230 232 interrupts_restore(ipl); … … 324 326 325 327 if (!list_empty(&rwl->exclusive.sem.wq.head)) 326 t = list_get_instance(rwl->exclusive.sem.wq.head.next, thread_t, wq_link); 328 t = list_get_instance(rwl->exclusive.sem.wq.head.next, thread_t, 329 wq_link); 327 330 do { 328 331 if (t) { … … 344 347 /* 345 348 * Waking up a reader. 346 * We are responsible for incrementing rwl->readers_in for it. 349 * We are responsible for incrementing rwl->readers_in 350 * for it. 347 351 */ 348 352 rwl->readers_in++; … … 361 365 t = NULL; 362 366 if (!list_empty(&rwl->exclusive.sem.wq.head)) { 363 t = list_get_instance(rwl->exclusive.sem.wq.head.next, thread_t, wq_link); 367 t = list_get_instance(rwl->exclusive.sem.wq.head.next, 368 thread_t, wq_link); 364 369 if (t) { 365 370 spinlock_lock(&t->lock);
Note:
See TracChangeset
for help on using the changeset viewer.