
Earlier thread initialization was done in poll_waitevents(), which was somewhat confusing, since the main thread also calls into poll_waitevents(). Now there is a specific thread "main" function, which first performs thread specific initialization and then calls into poll_waitevents().