}
cancel_code = pthread_cancel(master);
+ pthread_kill(master, SIGURG);
ast_debug(4,
"Waiting to join thread of span %d "
"with pid=%p cancel_code=%d\n",
#ifdef HAVE_PRI
for (i = 0; i < NUM_SPANS; i++) {
- if (pris[i].pri.master != AST_PTHREADT_NULL)
+ if (pris[i].pri.master != AST_PTHREADT_NULL) {
pthread_cancel(pris[i].pri.master);
+ pthread_kill(pris[i].pri.master, SIGURG);
+ }
}
ast_cli_unregister_multiple(dahdi_pri_cli, ARRAY_LEN(dahdi_pri_cli));
ast_unregister_application(dahdi_send_keypad_facility_app);
#endif
#if defined(HAVE_SS7)
for (i = 0; i < NUM_SPANS; i++) {
- if (linksets[i].ss7.master != AST_PTHREADT_NULL)
+ if (linksets[i].ss7.master != AST_PTHREADT_NULL) {
pthread_cancel(linksets[i].ss7.master);
+ pthread_kill(linksets[i].ss7.master, SIGURG);
}
+ }
ast_cli_unregister_multiple(dahdi_ss7_cli, ARRAY_LEN(dahdi_ss7_cli));
#endif /* defined(HAVE_SS7) */
#if defined(HAVE_OPENR2)
#if defined(HAVE_PRI)
for (i = 0; i < NUM_SPANS; i++) {
- if (pris[i].pri.master && (pris[i].pri.master != AST_PTHREADT_NULL))
+ if (pris[i].pri.master && (pris[i].pri.master != AST_PTHREADT_NULL)) {
pthread_join(pris[i].pri.master, NULL);
+ }
for (j = 0; j < SIG_PRI_NUM_DCHANS; j++) {
dahdi_close_pri_fd(&(pris[i]), j);
}
#if defined(HAVE_SS7)
for (i = 0; i < NUM_SPANS; i++) {
- if (linksets[i].ss7.master && (linksets[i].ss7.master != AST_PTHREADT_NULL))
+ if (linksets[i].ss7.master && (linksets[i].ss7.master != AST_PTHREADT_NULL)) {
pthread_join(linksets[i].ss7.master, NULL);
+ }
for (j = 0; j < SIG_SS7_NUM_DCHANS; j++) {
dahdi_close_ss7_fd(&(linksets[i]), j);
}
ss7_event *e = NULL;
struct sig_ss7_chan *p;
struct pollfd pollers[SIG_SS7_NUM_DCHANS];
- int nextms = 0;
+ int nextms;
+
+#define SS7_MAX_POLL 60000 /* Maximum poll time in ms. */
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
}
nextms = tv.tv_sec * 1000;
nextms += tv.tv_usec / 1000;
+ if (SS7_MAX_POLL < nextms) {
+ nextms = SS7_MAX_POLL;
+ }
+ } else {
+ nextms = SS7_MAX_POLL;
}
for (i = 0; i < linkset->numsigchans; i++) {