Merge BSD stack size work (bug #2067)
[asterisk/asterisk.git] / channels / chan_skinny.c
index df3398d..db8a1ae 100755 (executable)
@@ -2113,7 +2113,7 @@ static int handle_message(skinny_req *req, struct skinnysession *s)
                                        c = skinny_new(sub, AST_STATE_DOWN);                    
                                        if(c) {
                                                /* start switch */
-                                               if (pthread_create(&t, NULL, skinny_ss, c)) {
+                                               if (ast_pthread_create(&t, NULL, skinny_ss, c)) {
                                                        ast_log(LOG_WARNING, "Unable to create switch thread: %s\n", strerror(errno));
                                                        ast_hangup(c);
                                                }
@@ -2403,7 +2403,7 @@ static void *accept_thread(void *ignore)
                sessions = s;
                ast_mutex_unlock(&sessionlock);
                
-               if (pthread_create(&tcp_thread, NULL, skinny_session, s)) {
+               if (ast_pthread_create(&tcp_thread, NULL, skinny_session, s)) {
                        destroy_session(s);
                }
        }
@@ -2461,7 +2461,7 @@ static int restart_monitor(void)
                pthread_kill(monitor_thread, SIGURG);
        } else {
                /* Start a new monitor */
-               if (pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
+               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;
@@ -2649,7 +2649,7 @@ static int reload_config(void)
                                ast_verbose(VERBOSE_PREFIX_2 "Skinny listening on %s:%d\n", 
                                        ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr), ntohs(bindaddr.sin_port));
 
-                       pthread_create(&accept_t,NULL, accept_thread, NULL);
+                       ast_pthread_create(&accept_t,NULL, accept_thread, NULL);
                }
        }
        ast_mutex_unlock(&netlock);