aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-28 20:46:01 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-28 20:46:01 +0000
commit1b36eef6f45c9e4719848747494e1b839f5a1508 (patch)
tree93f9b6140eb5d6e502d59f61dc94af1c440c16b8 /include
parentb90c312913754e4e0f9dad38a9cc7b7ac21160d5 (diff)
Convert the PBX core to use read/write locks. This yields a nifty performance improvement when it comes to simultaneous calls going through the dialplan. Using murf's test the old mutex based core took an average of 57.3 seconds while the rwlock based core took 31.1 seconds. That's a nifty 26.2 seconds performance improvement. The other good part is that if we do need to switch back then we just have to change the lock/unlock API calls. I converted everywhere that used to touch the mutex locks directly to use them.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@57184 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/pbx.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index 56d50eb56..2759b36d1 100644
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -669,12 +669,20 @@ int ast_ignore_pattern(const char *context, const char *pattern);
/* Locking functions for outer modules, especially for completion functions */
/*!
- * \brief Locks the context list
+ * \brief Write locks the context list
*
* \retval 0 on success
* \retval -1 on error
*/
-int ast_lock_contexts(void);
+int ast_wrlock_contexts(void);
+
+/*!
+ * \brief Read locks the context list
+ *
+ * \retval 0 on success
+ * \retval -1 on error
+ */
+int ast_rdlock_contexts(void);
/*!
* \brief Unlocks contexts
@@ -685,14 +693,24 @@ int ast_lock_contexts(void);
int ast_unlock_contexts(void);
/*!
- * \brief Locks a given context
+ * \brief Write locks a given context
*
* \param con context to lock
*
* \retval 0 on success
* \retval -1 on failure
*/
-int ast_lock_context(struct ast_context *con);
+int ast_wrlock_context(struct ast_context *con);
+
+/*!
+ * \brief Read locks a given context
+ *
+ * \param con context to lock
+ *
+ * \retval 0 on success
+ * \retval -1 on failure
+ */
+int ast_rdlock_context(struct ast_context *con);
/*!
* \retval Unlocks the given context