Call OSmessageLoop() from the main thread