aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-13 15:25:16 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-13 15:25:16 +0000
commitdbc9edcaac6ec1d2059f4c5bcd27cca6c266f5bf (patch)
tree3f2cc11c392b1496cf6518e8b6eb99e8b04417a1 /pbx
parent231b9aad4020331a8c68d1a2826ee1ef930ec57b (diff)
Totally revamp thread debugging to support locating and removing deadlocks
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1310 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-xpbx/pbx_config.c10
-rwxr-xr-xpbx/pbx_gtkconsole.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index 1514503c3..c6c6190fb 100755
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -42,7 +42,7 @@ static char *registrar = "pbx_config";
static int static_config = 0;
static int write_protect_config = 1;
-static pthread_mutex_t save_dialplan_lock = AST_MUTEX_INITIALIZER;
+static ast_mutex_t save_dialplan_lock = AST_MUTEX_INITIALIZER;
static struct ast_context *local_contexts = NULL;
@@ -916,7 +916,7 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
if (argc != 2 && argc != 3) return RESULT_SHOWUSAGE;
- if (ast_pthread_mutex_lock(&save_dialplan_lock)) {
+ if (ast_mutex_lock(&save_dialplan_lock)) {
ast_cli(fd,
"Failed to lock dialplan saving (another proccess saving?)\n");
return RESULT_FAILURE;
@@ -945,7 +945,7 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
/* try to lock contexts list */
if (ast_lock_contexts()) {
ast_cli(fd, "Failed to lock contexts list\n");
- ast_pthread_mutex_unlock(&save_dialplan_lock);
+ ast_mutex_unlock(&save_dialplan_lock);
return RESULT_FAILURE;
}
@@ -954,7 +954,7 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
ast_cli(fd, "Failed to create file '%s'\n",
filename);
ast_unlock_contexts();
- ast_pthread_mutex_unlock(&save_dialplan_lock);
+ ast_mutex_unlock(&save_dialplan_lock);
return RESULT_FAILURE;
}
@@ -1077,7 +1077,7 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
}
ast_unlock_contexts();
- ast_pthread_mutex_unlock(&save_dialplan_lock);
+ ast_mutex_unlock(&save_dialplan_lock);
fclose(output);
if (incomplete) {
diff --git a/pbx/pbx_gtkconsole.c b/pbx/pbx_gtkconsole.c
index 4a6db3c87..13e29097b 100755
--- a/pbx/pbx_gtkconsole.c
+++ b/pbx/pbx_gtkconsole.c
@@ -41,7 +41,7 @@
#include "../asterisk.h"
#include "../astconf.h"
-static pthread_mutex_t verb_lock = AST_MUTEX_INITIALIZER;
+static ast_mutex_t verb_lock = AST_MUTEX_INITIALIZER;
static pthread_t console_thread;
@@ -125,10 +125,10 @@ static void __verboser(char *stuff, int opos, int replacelast, int complete)
static void verboser(char *stuff, int opos, int replacelast, int complete)
{
- ast_pthread_mutex_lock(&verb_lock);
+ ast_mutex_lock(&verb_lock);
/* Lock appropriately if we're really being called in verbose mode */
__verboser(stuff, opos, replacelast, complete);
- ast_pthread_mutex_unlock(&verb_lock);
+ ast_mutex_unlock(&verb_lock);
}
static void cliinput(void *data, int source, GdkInputCondition ic)