/* Dequeues and wakes up one thread from the queue, if any.  */
void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg)
/* Dequeues and wakes up one thread from the queue, if any.  */
void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg)
{
    queue_elem_t *e;
    osalDbgCheck(tqp != NULL);
    if (!ThreadsQueueIsEmpty(tqp))
    {
        e = ThreadsQueuePop(tqp);
        osalThreadResumeI(&e->tr, msg);
    }
}