Skip to content

Commit

Permalink
Merge pull request torvalds#187 from liuyuan10/mem
Browse files Browse the repository at this point in the history
lkl: decrease stack size of thread_create to PTHREAD_STACK_MIN
  • Loading branch information
Octavian Purdila authored Aug 3, 2016
2 parents 11f0696 + bee09a0 commit 47e5676
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/lkl/lib/posix-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <sys/socket.h>
#include <sys/syscall.h>
#include <poll.h>
#include <limits.h>
#include <lkl_host.h>
#include "iomem.h"

Expand Down Expand Up @@ -177,7 +178,10 @@ static void mutex_free(struct lkl_mutex *_mutex)
static lkl_thread_t thread_create(void (*fn)(void *), void *arg)
{
pthread_t thread;
if (WARN_PTHREAD(pthread_create(&thread, NULL, (void* (*)(void *))fn, arg)))
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
if (WARN_PTHREAD(pthread_create(&thread, &attr, (void* (*)(void *))fn, arg)))
return 0;
else
return (lkl_thread_t) thread;
Expand Down

0 comments on commit 47e5676

Please sign in to comment.