[Bug 1673] Chain append and prepend with empty check

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Aug 17 17:04:24 UTC 2010


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

--- Comment #4 from Peer Stritzinger <peerst at gmail.com> 2010-08-17 12:04:24 CDT ---
(In reply to comment #3)
> (In reply to comment #2)
> > Additionaly I think API calls along the line:
> > 
> > rtems_chain_get_with_empty_check() ...
> 
> Do we really need this? chain_get() already returns NULL if the chain is empty.

But I had a different application in mind: notify a producer if you took the
last one from the chain.
So the empty check would be after the last one was taken.

With chain_get there is the question of what is returned.

Because  of this it might even make sense to have the 

rtems_chain_append_with_notification( chain, node, tid, event) 

and

rtems_chain_get_with_notification (chain, tid, event)  -> node

functions instead.  These were the functions Joel suggested to me in IRC. 
Their disadvantage are of course that in theory they are less flexible.  But in
practice they encapsulate a very common use case.

-- 
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