Changeset 8264867 in mainline for kernel/generic/src/synch/mutex.c


Ignore:
Timestamp:
2012-05-08T10:47:30Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge from lp:~jakub/helenos/mm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/mutex.c

    r99d05e1 r8264867  
    4040#include <debug.h>
    4141#include <arch.h>
     42#include <stacktrace.h>
    4243
    4344/** Initialize mutex.
     
    8788                ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE));
    8889               
     90                unsigned int cnt = 0;
     91                bool deadlock_reported = false;
    8992                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                        }
    90100                        rc = semaphore_trydown(&mtx->sem);
    91101                } while (SYNCH_FAILED(rc) &&
    92102                    !(flags & SYNCH_FLAGS_NON_BLOCKING));
     103                if (deadlock_reported)
     104                        printf("cpu%u: not deadlocked\n", CPU->id);
    93105        }
    94106
Note: See TracChangeset for help on using the changeset viewer.