implemented mutex and thread functions without KASSERT