removed mutex/condition, using barriers instead