cyg_mbox_create
Name: cyg_mbox_create ( ) - create an mbox
Synopsis:
void cyg_mbox_create
(
  cyg_handle_t *handle, /* returned handle to mbox object */
  cyg_mbox     *mbox    /* mbox object                    */
)
Description: This creates an mbox. Mboxes are similar to message queues in other systems but in eCos all mboxes are of the same depth and they only pass void pointers around, nothing larger. The kernel determines the depth of the mboxes.

The mbox can be manipulated by "*handle".

Include: #include <cyg/kernel/kapi.h>
Returns: nothing
See Also: cyg_mbox_delete

cyg_mbox_delete
Name: cyg_mbox_delete ( ) - delete an mbox
Synopsis:
void cyg_mbox_delete
(
  cyg_handle_t mbox /* mbox to delete */
)
Description: This deletes an mbox. Be careful not to delete any mboxes that other threads may be waiting on or using or the system may deadlock.
Include: #include <cyg/kernel/kapi.h>
Returns: nothing
See Also: cyg_mbox_create

cyg_mbox_get
Name: cyg_mbox_get ( ) - get a pointer from an mbox
Synopsis:
void *cyg_mbox_get
(
  cyg_handle_t mbox /* mbox to read data from */
)
Description: This reads a pointer from an mbox. If the mbox has no data in it, this function will block the calling thread until data is available.
Include: #include <cyg/kernel/kapi.h>
Returns: a pointer to data that was placed in the mbox.
See Also: cyg_mbox_timed_get, cyg_mbox_tryget, cyg_mbox_peek_item, cyg_mbox_put, cyg_mbox_timed_put, cyg_mbox_tryput, cyg_mbox_peek, cyg_mbox_waiting_to_get, cyg_mbox_waiting_to_put

cyg_mbox_timed_get
Name: cyg_mbox_timed_get ( ) - get a pointer from an mbox with timeout
Synopsis:
void *cyg_mbox_timed_get
(
  cyg_handle_t     mbox,   /* mbox to read     */
  cyg_tick_count_t abstime /* absolute timeout */
)
Description: This reads data from an mbox. If the mbox has no data in it, this function will block the calling thread until data is available.

The delay is specified as an absolute time of the clock tick. To get a relative time use cyg_current_time to get the current system time and add an offset to that value.

Include: #include <cyg/kernel/kapi.h>
Returns: the retrieved pointer or NULL if the mailbox wait timed out.
See Also: cyg_mbox_get, cyg_mbox_tryget, cyg_mbox_peek_item, cyg_mbox_put, cyg_mbox_timed_put, cyg_mbox_tryput, cyg_mbox_peek, cyg_mbox_waiting_to_get, cyg_mbox_waiting_to_put

cyg_mbox_tryget
Name: cyg_mbox_tryget ( ) - get a pointer from a mbox with no block
Synopsis:
void *cyg_mbox_tryget
(
  cyg_handle_t mbox /* mailbox to read */
)
Description: This reads data from an mbox. If the mbox has no data in it, this function will not block but will return immediately and indicate a failure by returning NULL.
Include: #include <cyg/kernel/kapi.h>
Returns: the retrieved pointer or NULL if the mailbox was empty.
See Also: cyg_mbox_get, cyg_mbox_timed_get, cyg_mbox_peek_item, cyg_mbox_put, cyg_mbox_timed_put, cyg_mbox_tryput, cyg_mbox_peek, cyg_mbox_waiting_to_get, cyg_mbox_waiting_to_put

cyg_mbox_peek_item
Name: cyg_mbox_peek_item ( ) - get a pointer from an mbox without removing it
Synopsis:
void *cyg_mbox_peek_item
(
  cyg_handle_t mbox /* mailbox to read */
)
Description: This reads a pointer from an mbox. If the mbox has no data in it, this function will return immediately. If there is data in the mbox this will return the pointer to the data, but it will not remove the pointer from the mailbox queue.
Include: #include <cyg/kernel/kapi.h>
Returns: the retrieved pointer or NULL if the mailbox was empty.
See Also: cyg_mbox_get, cyg_mbox_timed_get, cyg_mbox_tryget, cyg_mbox_put, cyg_mbox_timed_put, cyg_mbox_tryput, cyg_mbox_peek, cyg_mbox_waiting_to_get, cyg_mbox_waiting_to_put

cyg_mbox_put
Name: cyg_mbox_put ( ) - place a pointer in an mbox
Synopsis:
cyg_bool_t cyg_mbox_put
(
  cyg_handle_t mbox, /* mbox to add pointer to */
  void         *item /* pointer to add to mbox */
)
Description: This places a message into an mbox. If the mbox is already full this function will block until the message is placed into the mbox. If the thread is awaken by the kernel during a wait, this function will return an error.
Include: #include <cyg/kernel/kapi.h>
Returns: "true" if the message was placed into the mbox, "false" otherwise.
See Also: cyg_mbox_get, cyg_mbox_timed_get, cyg_mbox_tryget, cyg_mbox_peek_item, cyg_mbox_timed_put, cyg_mbox_tryput, cyg_mbox_peek, cyg_mbox_waiting_to_get, cyg_mbox_waiting_to_put

cyg_mbox_timed_put
Name: cyg_mbox_timed_put ( ) - place a message into an mbox with timeout
Synopsis:
cyg_bool_t cyg_mbox_timed_put
(
  cyg_handle_t     mbox,   /* mbox to add pointer to */
  void             *item,  /* pointer to add to mbox */
  cyg_tick_count_t abstime /* absolute timeout value */
)
Description: This places a pointer into an mbox. If the mbox is already full this function will block until "abstime" or until the message is placed into the mbox.

The delay is specified as an absolute time of the clock tick. To get a relative time use cyg_current_time to get the current system time and add an offset to that value.

Include: #include <cyg/kernel/kapi.h>
Returns: "true" if the message was placed into the mbox, "false" otherwise.
See Also: cyg_mbox_get, cyg_mbox_timed_get, cyg_mbox_tryget, cyg_mbox_peek_item, cyg_mbox_put, cyg_mbox_tryput, cyg_mbox_peek, cyg_mbox_waiting_to_get, cyg_mbox_waiting_to_put

cyg_mbox_tryput
Name: cyg_mbox_tryput ( ) - place a message in an mbox with no blocking
Synopsis:
cyg_bool_t cyg_mbox_tryput
(
  cyg_handle_t mbox, /* mbox to add pointer to */
  void         *item /* pointer to add to mbox */
)
Description: This places a message into an mbox. If the mbox is full, this function will fail to place the message into the mbox. This function will never block.
Include: #include <cyg/kernel/kapi.h>
Returns: "true" if the message was placed into the mbox, "false" otherwise.
See Also: cyg_mbox_get, cyg_mbox_timed_get, cyg_mbox_tryget, cyg_mbox_peek_item, cyg_mbox_put, cyg_mbox_timed_put, cyg_mbox_peek, cyg_mbox_waiting_to_get, cyg_mbox_waiting_to_put

cyg_mbox_peek
Name: cyg_mbox_peek ( ) - get number of messages in mbox
Synopsis:
cyg_count32 cyg_mbox_peek
(
  cyg_handle_t mbox /* mbox to peek into */
)
Description: This function will return the number of messages waiting to be processed in an mbox.
Include: #include <cyg/kernel/kapi.h>
Returns: the number of messages currently in the given mbox.
See Also: cyg_mbox_get, cyg_mbox_timed_get, cyg_mbox_tryget, cyg_mbox_peek_item, cyg_mbox_put, cyg_mbox_timed_put, cyg_mbox_tryput, cyg_mbox_waiting_to_get, cyg_mbox_waiting_to_put

cyg_mbox_waiting_to_get
Name: cyg_mbox_waiting_to_get ( ) - check to see if threads wait to read from an mbox
Synopsis:
cyg_bool_t cyg_mbox_waiting_to_get
(
  cyg_handle_t mbox /* mbox to check */
)
Description: This indicates if any threads are being blocked while waiting for messages to be added to the mbox.
Include: #include <cyg/kernel/kapi.h>
Returns: "true" if threads are being blocked, "false" otherwise.
See Also: cyg_mbox_create, cyg_mbox_get, cyg_mbox_timed_get, cyg_mbox_tryget, cyg_mbox_peek_item, cyg_mbox_put, cyg_mbox_timed_put, cyg_mbox_tryput, cyg_mbox_peek, cyg_mbox_waiting_to_put

cyg_mbox_waiting_to_put
Name: cyg_mbox_waiting_to_put ( ) - check to see if thread waits to write to an mbox
Synopsis:
cyg_bool_t cyg_mbox_waiting_to_put
(
  cyg_handle_t mbox /* mbox to check */
)
Description: This indicates if any threads are being blocked while waiting for messages to be removed from the mbox.
Include: #include <cyg/kernel/kapi.h>
Returns: "true" if threads are being blocked, "false" otherwise.
See Also: cyg_mbox_create, cyg_mbox_get, cyg_mbox_timed_get, cyg_mbox_tryget, cyg_mbox_peek_item, cyg_mbox_put, cyg_mbox_timed_put, cyg_mbox_tryput, cyg_mbox_peek, cyg_mbox_waiting_to_get