X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=common%2Ftr_mq.c;h=6cf309fe88635e1e64558cc2e6bb9bf5850e7fda;hp=07080b66c91b16193f52fd182585ed5bd468ebc0;hb=d3d9b0eb4b1718cad404236d589fff2f16de2c37;hpb=74efd266be8e0672050401a890716cc089a2d609 diff --git a/common/tr_mq.c b/common/tr_mq.c index 07080b6..6cf309f 100644 --- a/common/tr_mq.c +++ b/common/tr_mq.c @@ -289,13 +289,17 @@ int tr_mq_pop_timeout(time_t seconds, struct timespec *ts) return 0; } -/* Caller must free msg via tr_mq_msg_free, waiting until absolute +/* Retrieves a message from the queue, waiting until absolute * time ts_abort before giving up (using CLOCK_MONOTONIC). If ts_abort * has passed, returns an existing message but will not wait if one is * not already available. If ts_abort is null, no blocking. Not * guaranteed to wait if an error occurs - immediately returns without * a message. Use tr_mq_pop_timeout() to get an absolute time that - * is guaranteed compatible with this function. */ + * is guaranteed compatible with this function. + * + * Caller should free msg via tr_mq_msg_free when done with it. It stays + * in the TR_MQ's context, though, so use talloc_steal() if you want to do + * something clever with it. */ TR_MQ_MSG *tr_mq_pop(TR_MQ *mq, struct timespec *ts_abort) { TR_MQ_MSG *popped=NULL;