Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Gramner <gramner@twoorioles.com>2019-12-13 01:09:56 +0300
committerHenrik Gramner <gramner@twoorioles.com>2019-12-17 21:01:24 +0300
commit6b611d36acab8ce1afdd528599322bb6b2d28727 (patch)
treeba9c996c79da0089f7f74d2f85de0f7c4be96064 /src/thread.h
parenteb211838b478491ac17ea2cbfa6e2797376e369e (diff)
Linux: Add a workaround for a glibc stack size issue
Diffstat (limited to 'src/thread.h')
-rw-r--r--src/thread.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/thread.h b/src/thread.h
index f3a35d1..0245d1b 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -72,9 +72,10 @@ static inline int pthread_attr_destroy(pthread_attr_t *const attr) {
}
static inline int pthread_attr_setstacksize(pthread_attr_t *const attr,
- const unsigned stack_size)
+ const size_t stack_size)
{
- attr->stack_size = stack_size;
+ if (stack_size > UINT_MAX) return 1;
+ attr->stack_size = (unsigned) stack_size;
return 0;
}