4.2.20 mutex_owned

int mutex_owned(kmutex_t *mutex)

The mutex_owned function returns non-zero if the calling thread currently holds the specified kernel mutex, or zero otherwise.