Changeset bed78cb in mainline for kernel/generic/src/synch/mutex.c
- Timestamp:
- 2012-05-10T07:28:31Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 81a7858
- Parents:
- 5b26747 (diff), fce7b43 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/mutex.c
r5b26747 rbed78cb 40 40 #include <debug.h> 41 41 #include <arch.h> 42 #include <stacktrace.h> 42 43 43 44 /** Initialize mutex. … … 61 62 return semaphore_count_get(&mtx->sem) <= 0; 62 63 } 64 65 #define MUTEX_DEADLOCK_THRESHOLD 100000000 63 66 64 67 /** Acquire mutex. … … 87 90 ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE)); 88 91 92 unsigned int cnt = 0; 93 bool deadlock_reported = false; 89 94 do { 95 if (cnt++ > MUTEX_DEADLOCK_THRESHOLD) { 96 printf("cpu%u: looping on active mutex %p\n", 97 CPU->id, mtx); 98 stack_trace(); 99 cnt = 0; 100 deadlock_reported = true; 101 } 90 102 rc = semaphore_trydown(&mtx->sem); 91 103 } while (SYNCH_FAILED(rc) && 92 104 !(flags & SYNCH_FLAGS_NON_BLOCKING)); 105 if (deadlock_reported) 106 printf("cpu%u: not deadlocked\n", CPU->id); 93 107 } 94 108
Note:
See TracChangeset
for help on using the changeset viewer.