How to disable all enemy spawner until boss is defeated?

I have a 2d game with a few Empty GameObjects, all called “Spawner”. They are tagged with “Spawner” as well. When 10 of such enemies are killed, I summon a boss.

if (enemiesKilled == 10) {
	enemiesKilled = 11;
	bossOne.SetActive(true);
}

However, there is a second boss summoned once 20 are defeated:

if (enemiesKilled == 20) {
	enemiesKilled = 21;
	bossTwo.SetActive(true);
}

The spawners still instantiate enemies while fighting the first boss, so the second boss can spawn while fighting the first. How can I disable all the spawners? I have seen other solutions but they do not seem to work for me. Thank you.

“How can I disable all spawners?”

bool boss10IsKilled = false;
GameObject[] spawners = GameObject.FindGameObjectsWithTag("Spawner");

foreach(GameObject spawner in spawners)
{
    spawner.SetActive(false);
}

if(boss10IsKilled)
{
foreach(GameObject spawner in spawners)
{
    spawner.SetActive(true);
}
}