Fix localmsg call issue in multi thread.