[Bug 1673] New: Chain append and prepend with empty check

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Fri Aug 13 13:24:08 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1673

           Summary: Chain append and prepend with empty check
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: sebastian.huber at embedded-brains.de


Created an attachment (id=1011)
 --> (https://www.rtems.org/bugzilla/attachment.cgi?id=1011)
Base API.

I want to propose new chain functions.  For the basic API please have a look at
the attached patch.

The following functions will be derived from them:

_Chain_Append_with_empty_check()
_Chain_Prepend_with_empty_check()
rtems_chain_append_with_empty_check_unprotected()
rtems_chain_prepend_with_empty_check_unprotected()
rtems_chain_append_with_empty_check()
rtems_chain_prepend_with_empty_check()

You can use this for very simple queues, e.g.

consumer:
  while (true) {
    wait for enqueue event receive;
    while (item = chain_get()) {
      process item;
    }
  }

producer:
  do_send_event = chain_append_with_empty_check(item)
  if (do_send_event) {
    send enqueue event;
  }

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list