Make chan_zap initialize the pri threads to AST_PTHREADT_NULL and check when calling...
authorJames Golovich <james@gnuinter.net>
Wed, 9 Jun 2004 08:46:32 +0000 (08:46 +0000)
committerJames Golovich <james@gnuinter.net>
Wed, 9 Jun 2004 08:46:32 +0000 (08:46 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3177 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 076ad18..d85e710 100755 (executable)
@@ -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;
        }