[asterisk-commits] tilghman: branch tilghman/issue18194 r303459 - in /team/tilghman/issue18194: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 24 02:26:17 CST 2011


Author: tilghman
Date: Mon Jan 24 02:26:13 2011
New Revision: 303459

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=303459
Log:
While we're breaking the lock API, make the APIs consistent between types

Modified:
    team/tilghman/issue18194/include/asterisk/lock.h
    team/tilghman/issue18194/main/heap.c
    team/tilghman/issue18194/main/lock.c

Modified: team/tilghman/issue18194/include/asterisk/lock.h
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/issue18194/include/asterisk/lock.h?view=diff&rev=303459&r1=303458&r2=303459
==============================================================================
--- team/tilghman/issue18194/include/asterisk/lock.h (original)
+++ team/tilghman/issue18194/include/asterisk/lock.h Mon Jan 24 02:26:13 2011
@@ -174,13 +174,13 @@
 
 int __ast_rwlock_init(int tracking, const char *filename, int lineno, const char *func, const char *rwlock_name, ast_rwlock_t *t);
 int __ast_rwlock_destroy(const char *filename, int lineno, const char *func, const char *rwlock_name, ast_rwlock_t *t);
-int __ast_rwlock_unlock(ast_rwlock_t *t, const char *name, const char *filename, int line, const char *func);
-int __ast_rwlock_rdlock(ast_rwlock_t *t, const char *name, const char *filename, int line, const char *func);
-int __ast_rwlock_wrlock(ast_rwlock_t *t, const char *name, const char *filename, int line, const char *func);
-int __ast_rwlock_timedrdlock(ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout, const char *filename, int line, const char *func);
-int __ast_rwlock_timedwrlock(ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout, const char *filename, int line, const char *func);
-int __ast_rwlock_tryrdlock(ast_rwlock_t *t, const char *name, const char *filename, int line, const char *func);
-int __ast_rwlock_trywrlock(ast_rwlock_t *t, const char *name, const char *filename, int line, const char *func);
+int __ast_rwlock_unlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name);
+int __ast_rwlock_rdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name);
+int __ast_rwlock_wrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name);
+int __ast_rwlock_timedrdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout);
+int __ast_rwlock_timedwrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout);
+int __ast_rwlock_tryrdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name);
+int __ast_rwlock_trywrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name);
 
 /*!
  * \brief wrapper for rwlock with tracking enabled
@@ -197,13 +197,13 @@
 #define ast_rwlock_init_notracking(rwlock) __ast_rwlock_init(0, __FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock)
 
 #define ast_rwlock_destroy(rwlock)         __ast_rwlock_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock)
-#define ast_rwlock_unlock(a)               __ast_rwlock_unlock(a, #a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ast_rwlock_rdlock(a)               __ast_rwlock_rdlock(a, #a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ast_rwlock_wrlock(a)               __ast_rwlock_wrlock(a, #a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ast_rwlock_tryrdlock(a)            __ast_rwlock_tryrdlock(a, #a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ast_rwlock_trywrlock(a)            __ast_rwlock_trywrlock(a, #a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ast_rwlock_timedrdlock(a, b)       __ast_rwlock_timedrdlock(a, #a, b, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ast_rwlock_timedwrlock(a, b)       __ast_rwlock_timedwrlock(a, #a, b, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ast_rwlock_unlock(a)               __ast_rwlock_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a)
+#define ast_rwlock_rdlock(a)               __ast_rwlock_rdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a)
+#define ast_rwlock_wrlock(a)               __ast_rwlock_wrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a)
+#define ast_rwlock_tryrdlock(a)            __ast_rwlock_tryrdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a)
+#define ast_rwlock_trywrlock(a)            __ast_rwlock_trywrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a)
+#define ast_rwlock_timedrdlock(a, b)       __ast_rwlock_timedrdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a, b)
+#define ast_rwlock_timedwrlock(a, b)       __ast_rwlock_timedwrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a, b)
 
 #define	ROFFSET	((lt->reentrancy > 0) ? (lt->reentrancy-1) : 0)
 

Modified: team/tilghman/issue18194/main/heap.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/issue18194/main/heap.c?view=diff&rev=303459&r1=303458&r2=303459
==============================================================================
--- team/tilghman/issue18194/main/heap.c (original)
+++ team/tilghman/issue18194/main/heap.c Mon Jan 24 02:26:13 2011
@@ -308,15 +308,15 @@
 
 int __ast_heap_wrlock(struct ast_heap *h, const char *file, const char *func, int line)
 {
-	return __ast_rwlock_wrlock(&h->lock, "&h->lock", file, line, func);
+	return __ast_rwlock_wrlock(file, line, func, &h->lock, "&h->lock");
 }
 
 int __ast_heap_rdlock(struct ast_heap *h, const char *file, const char *func, int line)
 {
-	return __ast_rwlock_rdlock(&h->lock, "&h->lock", file, line, func);
+	return __ast_rwlock_rdlock(file, line, func, &h->lock, "&h->lock");
 }
 
 int __ast_heap_unlock(struct ast_heap *h, const char *file, const char *func, int line)
 {
-	return __ast_rwlock_unlock(&h->lock, "&h->lock", file, line, func);
-}
+	return __ast_rwlock_unlock(file, line, func, &h->lock, "&h->lock");
+}

Modified: team/tilghman/issue18194/main/lock.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/issue18194/main/lock.c?view=diff&rev=303459&r1=303458&r2=303459
==============================================================================
--- team/tilghman/issue18194/main/lock.c (original)
+++ team/tilghman/issue18194/main/lock.c Mon Jan 24 02:26:13 2011
@@ -731,8 +731,7 @@
 	return res;
 }
 
-int __ast_rwlock_unlock(ast_rwlock_t *t, const char *name,
-	const char *filename, int line, const char *func)
+int __ast_rwlock_unlock(const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name)
 {
 	int res;
 
@@ -813,8 +812,7 @@
 	return res;
 }
 
-int __ast_rwlock_rdlock(ast_rwlock_t *t, const char *name,
-	const char *filename, int line, const char *func)
+int __ast_rwlock_rdlock(const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name)
 {
 	int res;
 
@@ -927,8 +925,7 @@
 	return res;
 }
 
-int __ast_rwlock_wrlock(ast_rwlock_t *t, const char *name,
-	const char *filename, int line, const char *func)
+int __ast_rwlock_wrlock(const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name)
 {
 	int res;
 
@@ -1041,8 +1038,8 @@
 	return res;
 }
 
-int __ast_rwlock_timedrdlock(ast_rwlock_t *t, const char *name,
-	const struct timespec *abs_timeout, const char *filename, int line, const char *func)
+int __ast_rwlock_timedrdlock(const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name,
+	const struct timespec *abs_timeout)
 {
 	int res;
 
@@ -1141,8 +1138,8 @@
 	return res;
 }
 
-int __ast_rwlock_timedwrlock(ast_rwlock_t *t, const char *name,
-	const struct timespec *abs_timeout, const char *filename, int line, const char *func)
+int __ast_rwlock_timedwrlock(const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name,
+	const struct timespec *abs_timeout)
 {
 	int res;
 
@@ -1241,8 +1238,7 @@
 	return res;
 }
 
-int __ast_rwlock_tryrdlock(ast_rwlock_t *t, const char *name,
-	const char *filename, int line, const char *func)
+int __ast_rwlock_tryrdlock(const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name)
 {
 	int res;
 
@@ -1307,8 +1303,7 @@
 	return res;
 }
 
-int __ast_rwlock_trywrlock(ast_rwlock_t *t, const char *name,
-	const char *filename, int line, const char *func)
+int __ast_rwlock_trywrlock(const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name)
 {
 	int res;
 




More information about the asterisk-commits mailing list