Completed mBeginThread function