On Friday, 19 January 2018 at 17:05:44 UTC, Chris M. wrote:
However when I try to spawn it in another thread it runs the function and then ends once it's done, like it's ignoring the while(true).
It is probably terminating the child threads when the main one ends. Might help to have the main wait until the child dies too.
But why are you putting it in a thread anyway? If the main is doing nothing than just waiting, might as well just keep the logic in there.