fix and optimize non-default-type mutex behavior