| 799 | |
| 800 | #ifdef INVARIANTS |
| 801 | static void |
| 802 | thread_lock_validate(struct mtx *m, int opts, const char *file, int line) |
| 803 | { |
| 804 | |
| 805 | KASSERT(m->mtx_lock != MTX_DESTROYED, |
| 806 | ("thread_lock() of destroyed mutex @ %s:%d", file, line)); |
| 807 | KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, |
| 808 | ("thread_lock() of sleep mutex %s @ %s:%d", |
| 809 | m->lock_object.lo_name, file, line)); |
| 810 | KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) == 0, |
| 811 | ("thread_lock: got a recursive mutex %s @ %s:%d\n", |
| 812 | m->lock_object.lo_name, file, line)); |
| 813 | WITNESS_CHECKORDER(&m->lock_object, |
| 814 | opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); |
| 815 | } |
| 816 | #else |
| 817 | #define thread_lock_validate(m, opts, file, line) do { } while (0) |
| 818 | #endif |
no outgoing calls
no test coverage detected