/* Sends the current thread sleeping and sets a reference variable.  */
msg_t osalThreadSuspendS(thread_reference_t *trp)
/* Sends the current thread sleeping and sets a reference variable.  */
msg_t osalThreadSuspendS(thread_reference_t *trp)
{
    thread_t thd;
    osalDbgCheck(trp != NULL);
    *trp = &thd;
    thd.handle = tx_thread_identify();
    thd.message = MSG_WAIT;
    while (thd.message == MSG_WAIT)
    {
        tx_thread_suspend(thd.handle);
        tx_thread_relinquish();
    }
    return thd.message;
}