From 1cf8cc81a1b41722ce4c6447f8434c9705540fc0 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Tue, 28 May 2013 16:17:15 +1000 Subject: [PATCH] Add a function to AsyncQueue to tell if we are connected --- asyncqueue.c | 11 +++++++++++ asyncqueue.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/asyncqueue.c b/asyncqueue.c index 1d3d7124..576900e3 100644 --- a/asyncqueue.c +++ b/asyncqueue.c @@ -1238,3 +1238,14 @@ void *AsyncUnitGetQueueContext(pAsyncUnit unit) assert(unit->queue); return unit->queue->context; } + + +int AsyncUnitIsQueueConnected(pAsyncUnit unit) +{ + assert(unit); + assert(unit->queue); + if (unit && unit->queue) + if (unit->queue->state == eAsyncConnected) + return 1; + return 0; +} diff --git a/asyncqueue.h b/asyncqueue.h index 60fed9ca..c2aa5a83 100644 --- a/asyncqueue.h +++ b/asyncqueue.h @@ -195,4 +195,8 @@ void *AsyncUnitSetQueueContext(pAsyncUnit handle, void *cntx); */ void *AsyncUnitGetQueueContext(pAsyncUnit handle); +/** \brief return one if queue is connected, zero otherwise + */ +int AsyncUnitIsQueueConnected(pAsyncUnit handle); + #endif /* SICSASYNCQUEUE */