aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-09 22:21:49 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-09 22:21:49 +0000
commit921ddf8e949f5bb3cd2f4e432a152879e3a80f5f (patch)
treeb66c2d4d4e424badca6fb1f2f741faae95bfbc92 /include/asterisk
parent69a84d074bc6198d6a951584babd24d0e143a3e5 (diff)
Merged revisions 85158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85158 | tilghman | 2007-10-09 16:55:06 -0500 (Tue, 09 Oct 2007) | 5 lines This commit fixes the following issues: - Deadlock in ast_write (issue #10406) - Deadlock in ast_read (issue #10406) - Possible mutex initialization error in lock.h (issue #10571) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85176 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/lock.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index f25070d8e..4273d25af 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -149,6 +149,11 @@ void ast_store_lock_info(enum ast_lock_type type, const char *filename,
void ast_mark_lock_acquired(void);
/*!
+ * \brief Mark the last lock as failed (trylock)
+ */
+void ast_mark_lock_failed(void);
+
+/*!
* \brief remove lock info for the current thread
*
* this gets called by ast_mutex_unlock so that information on the lock can
@@ -165,6 +170,7 @@ static inline int __ast_pthread_mutex_init_attr(int track, const char *filename,
const char *mutex_name, ast_mutex_t *t,
pthread_mutexattr_t *attr)
{
+ int i;
#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
int canlog = strcmp(filename, "logger.c");
@@ -180,10 +186,12 @@ static inline int __ast_pthread_mutex_init_attr(int track, const char *filename,
}
#endif
- t->file[0] = filename;
- t->lineno[0] = lineno;
- t->func[0] = func;
- t->thread[0] = 0;
+ for (i = 0; i < AST_MAX_REENTRANCY; i++) {
+ t->file[i] = NULL;
+ t->lineno[i] = 0;
+ t->func[i] = NULL;
+ t->thread[i] = 0;
+ }
t->reentrancy = 0;
t->track = track;