locking mechanisms and thread safety 6778812