This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can a RTX task mail itself?

Is it possible to for a task to send mail to itself?

example:

/* Wait for mail (actions) to arrive from other tasks */
WaitResult = os_mbx_wait(gsm_mailbox, (VOID**)&gsm_actionP, MS_TO_SYS_TICKS(GSM_TICK_PERIOD) );      /* Wait for the message to arrive. */
switch ( WaitResult )
{
        case OS_R_OK:
        case OS_R_MBX:                  /* message received in mailbox */
                gsm_perform_action();
                break;
        case OS_R_TMO:                  /* Timeout while waiting for message */

                os_mbx_send(gsm_mailbox, ActionPS, MS_TO_SYS_TICKS(TIMER_5_SEC) );  /* mail yourself*/
                break;
        default:                                                /* Unknown */
                break;
}

In this example I never get the mail.