if the lock protected a pthread_cond is held recursively, warn before waiting onthe condition

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Kevin P. Fleming 20 years ago
parent 5ec3844077
commit 4e04f5f731

@ -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);

Loading…
Cancel
Save