summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJames Golovich <james@gnuinter.net>2004-06-09 08:46:32 +0000
committerJames Golovich <james@gnuinter.net>2004-06-09 08:46:32 +0000
commita23c43cefac855ba3760078342ca3e3cf325453a (patch)
tree17cae2890b76359c1275ff9faa1597336d0a7b38 /channels
parent727abcdec7ad92fc2fae2585c5c609e0663858a6 (diff)
Make chan_zap initialize the pri threads to AST_PTHREADT_NULL and check when calling unload in case load_module fails complete
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_zap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 076ad18a1..d85e7102f 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -8094,7 +8094,8 @@ static int __unload_module(void)
#ifdef ZAPATA_PRI
int i;
for(i=0;i<NUM_SPANS;i++) {
- pthread_cancel(pris[i].master);
+ if (pris[i].master != AST_PTHREADT_NULL)
+ pthread_cancel(pris[i].master);
}
ast_cli_unregister(&pri_debug);
ast_cli_unregister(&pri_no_debug);
@@ -8798,6 +8799,7 @@ int load_module(void)
memset(pris, 0, sizeof(pris));
for (y=0;y<NUM_SPANS;y++) {
pris[y].offset = -1;
+ pris[y].master = AST_PTHREADT_NULL;
for (i=0;i<NUM_DCHANS;i++)
pris[y].fds[i] = -1;
}