Totally revamp thread debugging to support locating and removing deadlocks

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-08-13 15:25:16 +00:00
parent 4a396046fe
commit 1bb58646de
76 changed files with 1789 additions and 1723 deletions

View File

@@ -2,25 +2,26 @@
#define ASTERISK_LINKEDLISTS_H
#include <pthread.h>
#include <asterisk/lock.h>
#define AST_LIST_LOCK(head) \
ast_pthread_mutex_lock(&head->lock)
ast_mutex_lock(&head->lock)
#define AST_LIST_UNLOCK(head) \
ast_pthread_mutex_unlock(&head->lock)
ast_mutex_unlock(&head->lock)
#define AST_LIST_HEAD(name, type) \
struct name { \
struct type *first; \
pthread_mutex_t lock; \
ast_mutex_t lock; \
}
#define AST_LIST_HEAD_INITIALIZER(head) \
{ NULL, PTHREAD_MUTEX_INITIALIZER }
{ NULL, AST_MUTEX_INITIALIZER }
#define AST_LIST_HEAD_SET(head,entry) do { \
(head)->first=(entry); \
pthread_mutex_init(&(head)->lock,NULL); \
ast_pthread_mutex_init(&(head)->lock,NULL); \
} while (0)
#define AST_LIST_ENTRY(type) \
@@ -39,7 +40,7 @@ struct { \
#define AST_LIST_HEAD_INIT(head) { \
(head)->first = NULL; \
pthread_mutex_init(&(head)->lock,NULL); \
ast_pthread_mutex_init(&(head)->lock,NULL); \
}
#define AST_LIST_INSERT_AFTER(listelm, elm, field) do { \