Fix: Increase thread stack size for musl libc #115094
|
@ -13,8 +13,8 @@ CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
thread::thread(function<void()> run_cb) : run_cb_(run_cb), joined_(false)
|
thread::thread(function<void()> run_cb) : run_cb_(run_cb), joined_(false)
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) || defined(__linux__) && !defined(__GLIBC__)
|
||||||
/* Set the stack size to 2MB to match Linux. The default 512KB on macOS is
|
/* Set the stack size to 2MB to match glibc. The default 512KB on macOS is
|
||||||
* too small for Embree, and consistent stack size also makes things more
|
* too small for Embree, and consistent stack size also makes things more
|
||||||
* predictable in general. */
|
* predictable in general. */
|
||||||
pthread_attr_t attribute;
|
pthread_attr_t attribute;
|
||||||
|
@ -43,7 +43,7 @@ void *thread::run(void *arg)
|
||||||
bool thread::join()
|
bool thread::join()
|
||||||
{
|
{
|
||||||
joined_ = true;
|
joined_ = true;
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) || defined(__linux__) && !defined(__GLIBC__)
|
||||||
return pthread_join(pthread_id, NULL) == 0;
|
return pthread_join(pthread_id, NULL) == 0;
|
||||||
#else
|
#else
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -43,7 +43,7 @@ class thread {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
function<void()> run_cb_;
|
function<void()> run_cb_;
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) || defined(__linux__) && !defined(__GLIBC__)
|
||||||
pthread_t pthread_id;
|
pthread_t pthread_id;
|
||||||
#else
|
#else
|
||||||
std::thread std_thread;
|
std::thread std_thread;
|
||||||
|
|
Loading…
Reference in New Issue