Approaching trains activate a routine where, before the road lights and barriers are activated, all traffic signal phases go to red, except for the signal immediately after the crossing, which turns green (or flashing yellow) to allow traffic on the tracks to clear (in some cases, there are auxiliary traffic signals ...