mutex safety, well defined api