mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 10:58:15 +00:00
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
This commit is contained in:
@@ -396,6 +396,10 @@ static inline int __ast_cond_wait(const char *filename, int lineno, const char *
|
|||||||
#endif
|
#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) {
|
if (--t->reentrancy < 0) {
|
||||||
__ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
|
__ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
|
||||||
filename, lineno, func, mutex_name);
|
filename, lineno, func, mutex_name);
|
||||||
@@ -455,6 +459,10 @@ static inline int __ast_cond_timedwait(const char *filename, int lineno, const c
|
|||||||
#endif
|
#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) {
|
if (--t->reentrancy < 0) {
|
||||||
__ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
|
__ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
|
||||||
filename, lineno, func, mutex_name);
|
filename, lineno, func, mutex_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user