mtx_init & spin_init should set proper lock type
MODIFY
sys/kern/mutex.c
sys/kern/mutex.c
@@ -14,7 +14,7 @@ void mtx_init(mtx_t *m, lock_type_t type) {
m->m_owner = NULL;
m->m_count = 0;
m->m_lockpt = NULL;
- m->m_type = type;
+ m->m_type = type | LK_SLEEP;
}
void _mtx_lock(mtx_t *m, const void *waitpt) {

MODIFY
sys/kern/spinlock.c
sys/kern/spinlock.c
@@ -14,7 +14,7 @@ void spin_init(spin_t *s, lock_type_t type) {
s->s_owner = NULL;
s->s_count = 0;
s->s_lockpt = NULL;
- s->s_type = type;
+ s->s_type = type | LK_SPIN;
}
void _spin_lock(spin_t *s, const void *waitpt) {

mtx_init & spin_init should set proper lock type (#677)