summaryrefslogtreecommitdiff
path: root/channels/chan_phone.c
diff options
context:
space:
mode:
authorJames Golovich <james@gnuinter.net>2004-03-15 07:51:22 +0000
committerJames Golovich <james@gnuinter.net>2004-03-15 07:51:22 +0000
commit0e90480d6b6999320942b4e367836c20c0191a17 (patch)
tree9da7eefab98149c7669e84b70601e9e9d3b91ae5 /channels/chan_phone.c
parentc30ff0935d896c337fd9e72f560d924666fc044e (diff)
Fix bug 1217. Change pthread_t initializers to AST_PTHREADT_NULL and
AST_PTHREADT_STOP git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_phone.c')
-rwxr-xr-xchannels/chan_phone.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 775734842..5ebe02192 100755
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -67,7 +67,7 @@ static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
/* This is the thread for the monitor which checks for input on the channels
which are not currently in use. */
-static pthread_t monitor_thread = -1;
+static pthread_t monitor_thread = AST_PTHREADT_NULL;
static int restart_monitor(void);
@@ -910,7 +910,7 @@ static void *do_monitor(void *data)
static int restart_monitor()
{
/* If we're supposed to be stopped -- stay stopped */
- if (monitor_thread == -2)
+ if (monitor_thread == AST_PTHREADT_STOP)
return 0;
if (ast_mutex_lock(&monlock)) {
ast_log(LOG_WARNING, "Unable to lock monitor\n");
@@ -921,7 +921,7 @@ static int restart_monitor()
ast_log(LOG_WARNING, "Cannot kill myself\n");
return -1;
}
- if (monitor_thread != -1) {
+ if (monitor_thread != AST_PTHREADT_NULL) {
pthread_cancel(monitor_thread);
#if 0
pthread_join(monitor_thread, NULL);
@@ -1071,11 +1071,11 @@ static int __unload_module(void)
return -1;
}
if (!ast_mutex_lock(&monlock)) {
- if (monitor_thread > -1) {
+ if (monitor_thread > AST_PTHREADT_NULL) {
pthread_cancel(monitor_thread);
pthread_join(monitor_thread, NULL);
}
- monitor_thread = -2;
+ monitor_thread = AST_PTHREADT_STOP;
ast_mutex_unlock(&monlock);
} else {
ast_log(LOG_WARNING, "Unable to lock the monitor\n");