I do not see anything wrong with the code. I tried on my machine and FunctionMain should be called. How did you verify that it is not called?

On a side note, while(true) is the common paradigm for putting an infinite loop.