Changeset 8264867 in mainline for kernel/generic/src/synch
- Timestamp:
- 2012-05-08T10:47:30Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fce7b43
- Parents:
- 99d05e1 (diff), 8d2d308f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/generic/src/synch
- Files:
-
- 2 edited
-
mutex.c (modified) (2 diffs)
-
spinlock.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/mutex.c
r99d05e1 r8264867 40 40 #include <debug.h> 41 41 #include <arch.h> 42 #include <stacktrace.h> 42 43 43 44 /** Initialize mutex. … … 87 88 ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE)); 88 89 90 unsigned int cnt = 0; 91 bool deadlock_reported = false; 89 92 do { 93 if (cnt++ > DEADLOCK_THRESHOLD) { 94 printf("cpu%u: looping on active mutex %p\n", 95 CPU->id, mtx); 96 stack_trace(); 97 cnt = 0; 98 deadlock_reported = true; 99 } 90 100 rc = semaphore_trydown(&mtx->sem); 91 101 } while (SYNCH_FAILED(rc) && 92 102 !(flags & SYNCH_FLAGS_NON_BLOCKING)); 103 if (deadlock_reported) 104 printf("cpu%u: not deadlocked\n", CPU->id); 93 105 } 94 106 -
kernel/generic/src/synch/spinlock.c
r99d05e1 r8264867 44 44 #include <debug.h> 45 45 #include <symtab.h> 46 #include <stacktrace.h> 46 47 47 48 #ifdef CONFIG_SMP … … 104 105 "caller=%p (%s)\n", CPU->id, lock, lock->name, 105 106 (void *) CALLER, symtab_fmt_name_lookup(CALLER)); 107 stack_trace(); 106 108 107 109 i = 0; … … 260 262 int rc = spinlock_trylock(&(lock->lock)); 261 263 262 ASSERT_IRQ_SPINLOCK(! lock->guard, lock);264 ASSERT_IRQ_SPINLOCK(!rc || !lock->guard, lock); 263 265 return rc; 264 266 }
Note:
See TracChangeset
for help on using the changeset viewer.
