Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'agent/tcf/framework/channel.h')
-rw-r--r--agent/tcf/framework/channel.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/agent/tcf/framework/channel.h b/agent/tcf/framework/channel.h
index cecf73b4..ae1f9703 100644
--- a/agent/tcf/framework/channel.h
+++ b/agent/tcf/framework/channel.h
@@ -67,6 +67,7 @@ struct Channel {
LINK chanlink; /* Channel list */
LINK bclink; /* Broadcast list */
LINK susplink; /* Suspend list */
+ LINK locks; /* List of channel locks */
int congestion_level; /* Congestion level */
int state; /* Current state */
int disable_zero_copy; /* Don't send ZeroCopy in Hello message even if we support it */
@@ -195,11 +196,29 @@ extern void channel_lock(Channel *);
/*
* Unlock a channel.
* Each call of this function decrements the channel reference counter.
- * If channel is closed and reference count is zero, then the channel object is deallocated.
+ * If channel is closed and reference count is zero, then the channel object is closed.
*/
extern void channel_unlock(Channel *);
/*
+ * Lock a channel. Same as channel_lock(), but, if given a message (e.g. a service name),
+ * it will log a warning if the channel is not unlocked after it is closed.
+ * Note: same char pointer must be used for matching channel_unlock_with_msg() call.
+ */
+extern void channel_lock_with_msg(Channel *, const char *);
+
+/*
+ * Unlock a channel. To be used together with channel_lock_with_msg().
+ */
+extern void channel_unlock_with_msg(Channel *, const char *);
+
+/*
+ * Check for leaked channel locks. The function is called by
+ * channel implementation after the channel is disconnected.
+ */
+extern void check_channel_locks(Channel *);
+
+/*
* Return 1 if channel is closed, otherwise return 0.
*/
extern int is_channel_closed(Channel *);

Back to the top