ct_broadcast_enq

The ct_broadcast_enq function enqueues all threads at the highest priority.

Prototype:

int ct_broadcast_enq( void );

Parameters:

None.

Return Value:

CT_OKAY if successful, or CT_ERROR if not.

Discussion:

When the scheduler regains control, it enqueues all threads in the highest priority run queue. The thread calling ct_broadcast_enq() is the last thread enqueued.

This function is similar to ct_broadcast_msg(), except that it doesn't deliver any messages. As a result the threads don't need to examine or dequeue a message.

Restrictions:

Normally ct_broadcast_enq() will be called from a thread or user exit, i.e. while the scheduler is running.

You can also call ct_broadcast_enq() before the scheduler runs. In that case, any thread created before the scheduler starts will initially be enqueued at the highest priority, even if it normally has a lower priority.

After the scheduler has finished, calling ct_broadcast_enq() is possible but pointless, since there is neither a scheduler to enqueue threads nor any threads to enqueue. Such a call will also leak memory unless you call ct_clear() later to recover it.


Home