From 9174b0aca94fae0c483e2ae10608d660dc52f9c4 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 26 Aug 2013 10:35:12 +0200 Subject: Create threads with a 32 KB stack rather than what happens to be the default. On Linux, the default stack size is typically 8 MB. Patch by Fabian Mauchle. --- tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index 3b758a9..0ad574c 100644 --- a/tcp.c +++ b/tcp.c @@ -272,7 +272,7 @@ void tcpserverrd(struct client *client) { debug(DBG_DBG, "tcpserverrd: starting for %s", addr2string(client->addr)); - if (pthread_create(&tcpserverwrth, NULL, tcpserverwr, (void *)client)) { + if (pthread_create(&tcpserverwrth, &pthread_attr, tcpserverwr, (void *)client)) { debug(DBG_ERR, "tcpserverrd: pthread_create failed"); return; } @@ -353,7 +353,7 @@ void *tcplistener(void *arg) { debug(DBG_WARN, "accept failed"); continue; } - if (pthread_create(&tcpserverth, NULL, tcpservernew, (void *)&s)) { + if (pthread_create(&tcpserverth, &pthread_attr, tcpservernew, (void *)&s)) { debug(DBG_ERR, "tcplistener: pthread_create failed"); shutdown(s, SHUT_RDWR); close(s); -- cgit v1.1