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: https://origsvn.digium.com/svn/asterisk/trunk@85176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-10-09 22:21:49 +00:00
parent 7adbd6bb16
commit e9221b062e
3 changed files with 61 additions and 7 deletions

View File

@@ -148,6 +148,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
*
@@ -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;