[asterisk-commits] dlee: branch dlee/cache-ref-counting r394395 - /team/dlee/cache-ref-counting/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 15 15:52:31 CDT 2013


Author: dlee
Date: Mon Jul 15 15:52:29 2013
New Revision: 394395

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394395
Log:
Better comments

Modified:
    team/dlee/cache-ref-counting/main/stasis_cache.c

Modified: team/dlee/cache-ref-counting/main/stasis_cache.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/cache-ref-counting/main/stasis_cache.c?view=diff&rev=394395&r1=394394&r2=394395
==============================================================================
--- team/dlee/cache-ref-counting/main/stasis_cache.c (original)
+++ team/dlee/cache-ref-counting/main/stasis_cache.c Mon Jul 15 15:52:29 2013
@@ -79,18 +79,16 @@
 		RAII_VAR(struct stasis_caching_topic *, hold_ref, NULL,
 			ao2_cleanup);
 
-		/* Dispatching cache updates directly from the publisher thread
-		 * has an interesting side effect.
-		 *
-		 * The subscription may hold the last reference to this caching
-		 * topic. We want to make sure the destructor doesn't run
-		 * until after the unsubscribe finishes. */
+		/* The subscription may hold the last reference to this caching
+		 * topic, but we want to make sure the unsubscribe finishes
+		 * before kicking of the caching topic's dtor.
+		 */
 		ao2_ref(caching_topic, +1);
 		hold_ref = caching_topic;
 
 		if (stasis_subscription_is_subscribed(caching_topic->sub)) {
 			/* Increment the reference to hold on to it past the
-			 * unsubscribe */
+			 * unsubscribe. Will be cleaned up in dtor. */
 			ao2_ref(caching_topic->sub, +1);
 			stasis_unsubscribe(caching_topic->sub);
 		} else {




More information about the asterisk-commits mailing list