[asterisk-commits] dlee: branch dlee/stasis-cache-split r394772 - /team/dlee/stasis-cache-split/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 18 15:49:03 CDT 2013


Author: dlee
Date: Thu Jul 18 15:49:01 2013
New Revision: 394772

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394772
Log:
Got rid of extraneous locks on AO2 objects

Modified:
    team/dlee/stasis-cache-split/main/stasis_cache.c

Modified: team/dlee/stasis-cache-split/main/stasis_cache.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/main/stasis_cache.c?view=diff&rev=394772&r1=394771&r2=394772
==============================================================================
--- team/dlee/stasis-cache-split/main/stasis_cache.c (original)
+++ team/dlee/stasis-cache-split/main/stasis_cache.c Thu Jul 18 15:49:01 2013
@@ -129,7 +129,8 @@
 	ast_assert(type != NULL);
 	ast_assert(id != NULL);
 
-	entry = ao2_alloc(sizeof(*entry), cache_entry_dtor);
+	entry = ao2_alloc_options(sizeof(*entry), cache_entry_dtor,
+		AO2_ALLOC_OPT_LOCK_NOLOCK);
 	if (!entry) {
 		return NULL;
 	}
@@ -188,7 +189,8 @@
 {
         RAII_VAR(struct stasis_cache *, cache, NULL, ao2_cleanup);
 
-        cache = ao2_alloc(sizeof(*cache), cache_dtor);
+        cache = ao2_alloc_options(sizeof(*cache), cache_dtor,
+		AO2_ALLOC_OPT_LOCK_NOLOCK);
         if (!cache) {
                 return NULL;
         }
@@ -292,7 +294,8 @@
 	ast_assert(cache->entries != NULL);
 
 	cache_dump.type = type;
-	cache_dump.cached = ao2_container_alloc(1, NULL, NULL);
+	cache_dump.cached = ao2_container_alloc_options(
+		AO2_ALLOC_OPT_LOCK_NOLOCK, 1, NULL, NULL);
 	if (!cache_dump.cached) {
 		return NULL;
 	}
@@ -338,7 +341,8 @@
 	ast_assert(topic != NULL);
 	ast_assert(old_snapshot != NULL || new_snapshot != NULL);
 
-	update = ao2_alloc(sizeof(*update), stasis_cache_update_dtor);
+	update = ao2_alloc_options(sizeof(*update), stasis_cache_update_dtor,
+		AO2_ALLOC_OPT_LOCK_NOLOCK);
 	if (!update) {
 		return NULL;
 	}
@@ -441,7 +445,8 @@
 		return NULL;
 	}
 
-	caching_topic = ao2_alloc(sizeof(*caching_topic), stasis_caching_topic_dtor);
+	caching_topic = ao2_alloc_options(sizeof(*caching_topic),
+		stasis_caching_topic_dtor, AO2_ALLOC_OPT_LOCK_NOLOCK);
 	if (caching_topic == NULL) {
 		return NULL;
 	}




More information about the asterisk-commits mailing list