avoid keeping mutex locked over scheduler wait