diff options
author | Linus Nordberg <linus@nordberg.se> | 2013-08-26 10:35:12 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2013-09-02 13:44:28 +0200 |
commit | 55ca280f16473095380e22c574910f106b11058f (patch) | |
tree | f524607a18cce8e39c2cf9c0716659232e16c24c /tcp.c | |
parent | 05b360612d4f1bb48caedc766ede2109024bdc6f (diff) |
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.
Diffstat (limited to 'tcp.c')
-rw-r--r-- | tcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -276,7 +276,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; } @@ -357,7 +357,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); |