aboutsummaryrefslogtreecommitdiffstats
path: root/extras/libmemif/src/libmemif.h
diff options
context:
space:
mode:
authorMilan Lenco <milan.lenco@pantheon.tech>2017-10-12 14:19:31 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-10-12 18:18:54 +0000
commit0a47c99aed8124d2f4c3be0d90e961b82a6b9914 (patch)
tree0a1d68f9c45f645f8136bae84a1d6599987adde2 /extras/libmemif/src/libmemif.h
parent5f1231c5c2ba8483d1b723762d7001ee48956205 (diff)
libmemif: Add memif_cancel_poll_event() + bug fixing.
Change-Id: I27d6bf93216f1f639f01fad730506afdc7115e46 Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Diffstat (limited to 'extras/libmemif/src/libmemif.h')
-rw-r--r--extras/libmemif/src/libmemif.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/extras/libmemif/src/libmemif.h b/extras/libmemif/src/libmemif.h
index a2d1a5e28b5..da48edd4dee 100644
--- a/extras/libmemif/src/libmemif.h
+++ b/extras/libmemif/src/libmemif.h
@@ -72,6 +72,7 @@ typedef enum
MEMIF_ERR_DISCONNECT, /*!< disconenct received */
MEMIF_ERR_DISCONNECTED, /*!< peer interface disconnected */
MEMIF_ERR_UNKNOWN_MSG, /*!< unknown message type */
+ MEMIF_ERR_POLL_CANCEL, /*!< memif_poll_event() was cancelled */
} memif_err_t;
/**
@@ -438,6 +439,21 @@ int memif_rx_burst (memif_conn_handle_t conn, uint16_t qid,
\return memif_err_t
*/
int memif_poll_event (int timeout);
+
+/** \brief Send signal to stop concurrently running memif_poll_event().
+
+ The function, however, does not wait for memif_poll_event() to stop.
+ memif_poll_event() may still return simply because an event has occured
+ or the timeout has elapsed, but if called repeatedly in an infinite loop,
+ a canceled memif_poll_event() is guaranted to return MEMIF_ERR_POLL_CANCEL
+ in the shortest possible time.
+ This feature was not available in the first release.
+ Use macro MEMIF_HAVE_CANCEL_POLL_EVENT to check if the feature is present.
+
+ \return memif_err_t
+*/
+#define MEMIF_HAVE_CANCEL_POLL_EVENT 1
+int memif_cancel_poll_event ();
/** @} */
#endif /* _LIBMEMIF_H_ */