changed mutex semantics etc.