[Asterisk-cvs] asterisk/include/asterisk lock.h,1.32,1.33

kpfleming kpfleming
Tue Aug 9 11:34:00 CDT 2005


Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv14536/include/asterisk

Modified Files:
	lock.h 
Log Message:
eliminate compiler warnings when DEBUG_THREADS is enabled


Index: lock.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/lock.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- lock.h	26 Jul 2005 21:49:07 -0000	1.32
+++ lock.h	9 Aug 2005 15:37:33 -0000	1.33
@@ -293,6 +293,17 @@
 	return res;
 }
 
+static inline int ast_pthread_cond_wait(pthread_cond_t *cond, ast_mutex_t *ast_mutex)
+{
+	return pthread_cond_wait(cond, &ast_mutex->mutex);
+}
+
+static inline int ast_pthread_cond_timedwait(pthread_cond_t *cond, ast_mutex_t *ast_mutex,
+					     const struct timespec *abstime)
+{
+	return pthread_cond_timedwait(cond, &ast_mutex->mutex, abstime);
+}
+
 #define ast_mutex_unlock(a) __ast_pthread_mutex_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a)
 
 #define pthread_mutex_t use_ast_mutex_t_instead_of_pthread_mutex_t
@@ -301,6 +312,8 @@
 #define pthread_mutex_trylock use_ast_mutex_trylock_instead_of_pthread_mutex_trylock
 #define pthread_mutex_init use_ast_pthread_mutex_init_instead_of_pthread_mutex_init
 #define pthread_mutex_destroy use_ast_pthread_mutex_destroy_instead_of_pthread_mutex_destroy
+#define pthread_cond_wait use_ast_pthread_cond_wait_instead_of_pthread_cond_wait
+#define pthread_cond_timedwait use_ast_pthread_cond_wait_instead_of_pthread_cond_timedwait
 
 #else /* !DEBUG_THREADS */
 
@@ -366,7 +379,10 @@
 #define ast_mutex_trylock(pmutex) pthread_mutex_trylock(pmutex)
 #endif /* AST_MUTEX_INIT_W_CONSTRUCTORS */
 
-#endif /* DEBUG_THREADS */
+#define ast_pthread_cond_wait pthread_cond_wait
+#define ast_pthread_cond_timedwait pthread_cond_timedwait
+
+#endif /* !DEBUG_THREADS */
 
 #define AST_MUTEX_DEFINE_STATIC(mutex) __AST_MUTEX_DEFINE(static,mutex)
 #define AST_MUTEX_DEFINE_EXPORTED(mutex) __AST_MUTEX_DEFINE(/**/,mutex)




More information about the svn-commits mailing list