Mystery of escaping a while loop?

There's no loop because pulse_complete is immediately set to true.