Index: asterisk/channels/chan_h323.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v retrieving revision 1.121 diff -u -r1.121 chan_h323.c --- asterisk/channels/chan_h323.c 10 Jul 2005 23:49:57 -0000 1.121 +++ asterisk/channels/chan_h323.c 11 Jul 2005 02:31:17 -0000 @@ -39,6 +39,9 @@ #include #include #include +#ifdef __CYGWIN__ +#include "asterisk/win32.h" +#endif #include #include #include @@ -1601,9 +1604,15 @@ return -1; } if (monitor_thread && (monitor_thread != AST_PTHREADT_NULL)) { +#ifndef __CYGWIN__ /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { +#else + pthread_cancel(monitor_thread); + pthread_join(monitor_thread, NULL); + } +#endif pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /* Start a new monitor */ @@ -1612,8 +1621,9 @@ ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); return -1; } - +#ifndef __CYGWIN__ } +#endif ast_mutex_unlock(&monlock); return 0; } Index: asterisk/channels/chan_iax2.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v retrieving revision 1.317 diff -u -r1.317 chan_iax2.c --- asterisk/channels/chan_iax2.c 10 Jul 2005 23:49:57 -0000 1.317 +++ asterisk/channels/chan_iax2.c 11 Jul 2005 02:31:22 -0000 @@ -88,6 +88,10 @@ #define IPTOS_MINCOST 0x02 #endif +#ifdef __CYGWIN__ +#include "asterisk/win32.h" +#endif + #ifdef SO_NO_CHECK static int nochecksums = 0; #endif @@ -2466,7 +2470,9 @@ iaxq.count++; ast_mutex_unlock(&iaxq.lock); /* Wake up the network thread */ +#ifndef __CYGWIN__ pthread_kill(netthreadid, SIGURG); +#endif return 0; } @@ -7787,6 +7793,9 @@ if (freeme) iax_frame_free(freeme); } +#ifdef __CYGWIN__ + pthread_testcancel(); +#endif ast_mutex_unlock(&iaxq.lock); res = ast_sched_wait(sched); if ((res > 1000) || (res < 0)) Index: asterisk/channels/chan_mgcp.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v retrieving revision 1.128 diff -u -r1.128 chan_mgcp.c --- asterisk/channels/chan_mgcp.c 5 Jul 2005 17:16:16 -0000 1.128 +++ asterisk/channels/chan_mgcp.c 11 Jul 2005 02:31:24 -0000 @@ -98,6 +98,9 @@ #include "asterisk/utils.h" #include "asterisk/causes.h" #include "asterisk/dsp.h" +#ifdef __CYGWIN__ +#include "asterisk/win32.h" +#endif #ifndef IPTOS_MINCOST #define IPTOS_MINCOST 0x02 @@ -3471,16 +3474,24 @@ return -1; } if (monitor_thread != AST_PTHREADT_NULL) { +#ifndef __CYGWIN__ /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { +#else + pthread_cancel(monitor_thread); + pthread_join(monitor_thread, NULL); + } +#endif /* Start a new monitor */ if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) { ast_mutex_unlock(&monlock); ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); return -1; } +#ifndef __CYGWIN__ } +#endif ast_mutex_unlock(&monlock); return 0; } Index: asterisk/channels/chan_oss.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_oss.c,v retrieving revision 1.52 diff -u -r1.52 chan_oss.c --- asterisk/channels/chan_oss.c 10 Jul 2005 23:49:57 -0000 1.52 +++ asterisk/channels/chan_oss.c 11 Jul 2005 02:31:24 -0000 @@ -26,7 +26,7 @@ #ifdef __linux #include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__)|| defined(__CYGWIN__) #include #else #include Index: asterisk/channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.777 diff -u -r1.777 chan_sip.c --- asterisk/channels/chan_sip.c 10 Jul 2005 23:49:57 -0000 1.777 +++ asterisk/channels/chan_sip.c 11 Jul 2005 02:31:32 -0000 @@ -30,6 +30,9 @@ #include #include #include +#ifdef __CYGWIN__ +#include "asterisk/win32.h" +#endif #include "asterisk.h" @@ -9879,9 +9882,15 @@ return -1; } if (monitor_thread != AST_PTHREADT_NULL) { +#ifndef __CYGWIN__ /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { +#else + pthread_cancel(monitor_thread); + pthread_join(monitor_thread, NULL); + } +#endif pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /* Start a new monitor */ @@ -9890,7 +9899,9 @@ ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); return -1; } +#ifndef __CYGWIN__ } +#endif ast_mutex_unlock(&monlock); return 0; } Index: asterisk/channels/chan_skinny.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v retrieving revision 1.87 diff -u -r1.87 chan_skinny.c --- asterisk/channels/chan_skinny.c 10 Jul 2005 23:49:57 -0000 1.87 +++ asterisk/channels/chan_skinny.c 11 Jul 2005 02:31:34 -0000 @@ -29,6 +29,9 @@ #include #include #include +#ifdef __CYGWIN__ +#include "asterisk/win32.h" +#endif #include "asterisk.h" @@ -2961,11 +2964,25 @@ struct protoent *p; int arg = 1; pthread_attr_t attr; +#ifdef __CYGWIN__ + int ps; + struct pollfd fds[1]; +#endif pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); for (;;) { +#ifdef __CYGWIN__ + fds[0].fd = skinnysock; + fds[0].events= POLLIN; + ps = poll(fds, 1, -1); + if (ps < 0) { + if (errno != EINTR) + ast_log(LOG_WARNING, "manager poll returned error: %s\n", strerror(errno)); + continue; + } +#endif sinlen = sizeof(sin); as = accept(skinnysock, (struct sockaddr *)&sin, &sinlen); if (as < 0) { @@ -3046,16 +3063,24 @@ return -1; } if (monitor_thread != AST_PTHREADT_NULL) { +#ifndef __CYGWIN__ /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { +#else + pthread_cancel(monitor_thread); + pthread_join(monitor_thread, NULL); + } +#endif /* Start a new monitor */ if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) { ast_mutex_unlock(&monlock); ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); return -1; } +#ifndef __CYGWIN__ } +#endif ast_mutex_unlock(&monlock); return 0; } Index: asterisk/channels/iax2-parser.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/iax2-parser.c,v retrieving revision 1.47 diff -u -r1.47 iax2-parser.c --- asterisk/channels/iax2-parser.c 13 Jun 2005 08:48:17 -0000 1.47 +++ asterisk/channels/iax2-parser.c 11 Jul 2005 02:31:35 -0000 @@ -13,6 +13,10 @@ #include #include +#ifdef __CYGWIN__ +#include "asterisk/win32.h" +#include +#endif #include #include