`msg_q` should be static in this function.