To create message loop in each thread