# xQueueRemoveItem modifications

**URL:** <https://forums.freertos.org/t/xqueueremoveitem-modifications/6139>\
**Category:** Kernel\
**Created:** [September 3, 2016, 3:10am UTC](https://forums.freertos.org/t/xqueueremoveitem-modifications/6139 "2016-09-03T03:10:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 3, 2016, 3:10am UTC](https://forums.freertos.org/t/xqueueremoveitem-modifications/6139/1 "2016-09-03T03:10:58Z")

</div>

**[glenenglish](https://sourceforge.net/u/glenenglish/)** wrote on [Saturday, September 03, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/0fd4da79/#97fa):

xQueueRemoveItem does not exist. (but would be useful)

This is a function I need in the case where I just want to pull an item off the queue and discard it - IE I dont want to copy it or do anything with it. This is a case where I am trying to maintain a filling level of buffers to 50% (remove for packets to dry up, or flood in ) .  
I pass a NULL pointer to QueueReceive() instead

I modified prvCopyDataFromQueue to not call MEMCPY if pvBuffer was NULL;

and in xQueueGenericReceive  
I also removed the assert check for pvBuffer == NULL

This of course could be dangerous for callers that do not intentionally set pvBuffer to NULL…  
I could copy the fn with some different params.

glen

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [September 3, 2016, 3:43pm UTC](https://forums.freertos.org/t/xqueueremoveitem-modifications/6139/2 "2016-09-03T15:43:29Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Saturday, September 03, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/0fd4da79/#97fa/1aef):

At the moment the convoluted asserts in some of the queue functions are  
designed to only allow you to pass in a null pointer if the queue is in  
fact a semaphore (semaphores not having any data associated with them -  
only the count is of interest).
