aports/community/blender/0003-increase-thread-stack-size-for-musl.patch
2022-03-09 11:50:59 +01:00

49 lines
1.5 KiB
Diff

From 40264fa76d5a046db41fda73efac99f270b9006a Mon Sep 17 00:00:00 2001
From: Damian Kurek <starfire24680@gmail.com>
Date: Fri, 3 Dec 2021 17:55:35 +0000
Subject: [PATCH 3/3] increase thread stack size for musl
---
intern/cycles/util/thread.cpp | 4 ++--
intern/cycles/util/thread.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/intern/cycles/util/thread.cpp b/intern/cycles/util/thread.cpp
index e2e785b..78f4959 100644
--- a/intern/cycles/util/thread.cpp
+++ b/intern/cycles/util/thread.cpp
@@ -23,7 +23,7 @@ CCL_NAMESPACE_BEGIN
thread::thread(function<void()> run_cb) : run_cb_(run_cb), joined_(false)
{
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__MUSL__)
/* Set the stack size to 2MB to match Linux. The default 512KB on macOS is
* too small for Embree, and consistent stack size also makes things more
* predictable in general. */
@@ -53,7 +53,7 @@ void *thread::run(void *arg)
bool thread::join()
{
joined_ = true;
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__MUSL__)
return pthread_join(pthread_id, NULL) == 0;
#else
try {
diff --git a/intern/cycles/util/thread.h b/intern/cycles/util/thread.h
index bd6a83e..b469d27 100644
--- a/intern/cycles/util/thread.h
+++ b/intern/cycles/util/thread.h
@@ -54,7 +54,7 @@ class thread {
protected:
function<void()> run_cb_;
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__MUSL__)
pthread_t pthread_id;
#else
std::thread std_thread;
--
2.35.1