aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-29 01:25:28 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-29 01:25:28 +0000
commit63590e83853648e00e01b375192247fb6ec57928 (patch)
tree1b30ca09f2b94426528af90f719dba554431e790 /include
parent2def7994a1f963dc8a56bfdcf73ac756fc570fb6 (diff)
if the lock protected a pthread_cond is held recursively, warn before waiting onthe condition
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7213 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rwxr-xr-xinclude/asterisk/lock.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index cea5d06a1..39af89736 100755
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -396,6 +396,10 @@ static inline int __ast_cond_wait(const char *filename, int lineno, const char *
#endif
}
+ if (t->reentrancy)
+ __ast_mutex_logger("%s line %d (%s): mutex '%s' locked more than once, cond_wait will block!\n",
+ filename, lineno, func, mutex_name);
+
if (--t->reentrancy < 0) {
__ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
filename, lineno, func, mutex_name);
@@ -455,6 +459,10 @@ static inline int __ast_cond_timedwait(const char *filename, int lineno, const c
#endif
}
+ if (t->reentrancy)
+ __ast_mutex_logger("%s line %d (%s): mutex '%s' locked more than once, cond_timedwait will block!\n",
+ filename, lineno, func, mutex_name);
+
if (--t->reentrancy < 0) {
__ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
filename, lineno, func, mutex_name);