Changes in kernel/generic/src/synch/mutex.c [9d58539:fce7b43] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/mutex.c
r9d58539 rfce7b43 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.