thread pool funcitoin convert.