Changes in kernel/generic/src/synch/mutex.c [fce7b43:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/mutex.c
rfce7b43 r9d58539 40 40 #include <debug.h> 41 41 #include <arch.h> 42 #include <stacktrace.h>43 42 44 43 /** Initialize mutex. … … 62 61 return semaphore_count_get(&mtx->sem) <= 0; 63 62 } 64 65 #define MUTEX_DEADLOCK_THRESHOLD 10000000066 63 67 64 /** Acquire mutex. … … 90 87 ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE)); 91 88 92 unsigned int cnt = 0;93 bool deadlock_reported = false;94 89 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 }102 90 rc = semaphore_trydown(&mtx->sem); 103 91 } while (SYNCH_FAILED(rc) && 104 92 !(flags & SYNCH_FLAGS_NON_BLOCKING)); 105 if (deadlock_reported)106 printf("cpu%u: not deadlocked\n", CPU->id);107 93 } 108 94
Note:
See TracChangeset
for help on using the changeset viewer.