Signed-off-by: Taras Kondratiuk <[email protected]>
---
 platform/linux-generic/odp_queue.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/platform/linux-generic/odp_queue.c 
b/platform/linux-generic/odp_queue.c
index 1318bcd..f44aba0 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -192,6 +192,23 @@ odp_queue_t odp_queue_create(const char *name, 
odp_queue_type_t type,
        return handle;
 }
 
+int odp_queue_destroy(odp_queue_t handle)
+{
+       queue_entry_t *queue;
+       queue = queue_to_qentry(handle);
+
+       if (queue->s.status == QUEUE_STATUS_FREE)
+               return -1; /* Queue is alredy freed */
+
+       LOCK(&queue->s.lock);
+       queue->s.status = QUEUE_STATUS_FREE;
+       queue->s.head = NULL;
+       queue->s.tail = NULL;
+       queue->s.sched_buf = ODP_BUFFER_INVALID;
+       UNLOCK(&queue->s.lock);
+
+       return 0;
+}
 
 odp_buffer_t queue_sched_buf(odp_queue_t handle)
 {
-- 
1.7.9.5


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to