thread_proc (ulong thread_id, pstruct args_ptr, int arg_size)
{
  message_queue = create_queue ();

  post_event (args->event, message_queue), { args = (p_event_and_queue) args_ptr };

  parent_msg_queue = args->queue, { args = (p_event_and_queue) args_ptr };

  ...

}
/
{
  free (&message_queue);
}