pulsein function infinite loop

pulsein function infinite loop, waiting for a second signal when there is no exit condition, if not it will have been waiting for.

Not sure of your wording and if there is a question there or not. The pulseIn() command can have a optional 3rd argument that defines a time-out period if the desired pulse transition(s) never occur.

http://arduino.cc/en/Reference/PulseIn

Sorry,My english is poor.

I saw it in the file source code. Timeout signal is valid only for the front, in the last loop is not out of the code.
I have modified code have been found, but it does not seem accurate at the time.

(arduino v21 for windows,source code in file 'hardware/arduino/cores/arduino/wiring_pulse.c')

This will be fixed in Arduino 0022: pulseIn() now times out while measuring the pulse, not just while wai… · arduino/Arduino@4dad135 · GitHub