diff options
author | Linus Nordberg <linus@nordberg.se> | 2013-08-26 10:35:12 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2013-08-26 11:49:59 +0200 |
commit | 9174b0aca94fae0c483e2ae10608d660dc52f9c4 (patch) | |
tree | b68721bed0ae254b0a23a12bd1577acbf57e5021 /dtls.c | |
parent | 500c70ce169a9bc700ed4f05fa9c37e7df13a387 (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 'dtls.c')
-rw-r--r-- | dtls.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -305,7 +305,7 @@ void dtlsserverrd(struct client *client) { debug(DBG_DBG, "dtlsserverrd: starting for %s", addr2string(client->addr)); - if (pthread_create(&dtlsserverwrth, NULL, dtlsserverwr, (void *)client)) { + if (pthread_create(&dtlsserverwrth, &pthread_attr, dtlsserverwr, (void *)client)) { debug(DBG_ERR, "dtlsserverrd: pthread_create failed"); return; } @@ -508,7 +508,7 @@ void *udpdtlsserverrd(void *arg) { if (udp2bio(s, params->sesscache->rbios, cnt)) { debug(DBG_DBG, "udpdtlsserverrd: got DTLS in UDP from %s", addr2string((struct sockaddr *)&from)); - if (!pthread_create(&dtlsserverth, NULL, dtlsservernew, (void *)params)) { + if (!pthread_create(&dtlsserverth, &pthread_attr, dtlsservernew, (void *)params)) { pthread_detach(dtlsserverth); cacheexpire(sessioncache, &lastexpiry); continue; @@ -697,10 +697,10 @@ void initextradtls() { } if (client4_sock >= 0) - if (pthread_create(&cl4th, NULL, udpdtlsclientrd, (void *)&client4_sock)) + if (pthread_create(&cl4th, &pthread_attr, udpdtlsclientrd, (void *)&client4_sock)) debugx(1, DBG_ERR, "pthread_create failed"); if (client6_sock >= 0) - if (pthread_create(&cl6th, NULL, udpdtlsclientrd, (void *)&client6_sock)) + if (pthread_create(&cl6th, &pthread_attr, udpdtlsclientrd, (void *)&client6_sock)) debugx(1, DBG_ERR, "pthread_create failed"); } #else |