As written by others, it is impossible to determine.
However, if you want to do some testing, you can use the WatchDog design template. This is a separate thread that checks if a task is active. Your own stream should regularly signal to say that it is alive. Make sure this signal is not set inside your (infinite) loop.
If there was no signal, the program is in an endless loop or stopped, and the watchdog timer can act on it.
source share