diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-16 21:38:29 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-16 21:38:29 +0000 |
commit | 29dd5fa7c6db694f328b42ae597c3a59b7d17d1d (patch) | |
tree | 884e4c8f38c59e397c760d9a3e4d9678a760c78a /main | |
parent | a9fd8bb1b05d97a3f3fae4ff3ad2db170b1b8c5c (diff) |
Fix an issue where DEBUG_THREADS may erroneously report that a thread
is exiting while holding a lock.
If the last lock attempt was a trylock, and it failed, it will still be in the
list of locks so that it can be reported.
(closes issue #13219)
Reported by: pj
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164881 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/utils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c index a8d15bba0..bbebe8b35 100644 --- a/main/utils.c +++ b/main/utils.c @@ -515,6 +515,12 @@ static void lock_info_destroy(void *data) for (i = 0; i < lock_info->num_locks; i++) { + if (lock_info->locks[i].pending == -1) { + /* This just means that the last lock this thread went for was by + * using trylock, and it failed. This is fine. */ + break; + } + ast_log(LOG_ERROR, "Thread '%s' still has a lock! - '%s' (%p) from '%s' in %s:%d!\n", lock_info->thread_name, |