diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-14 16:37:57 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-14 19:21:55 +0300 |
commit | fb6f1aa12f945c6a17ca96f402dec2f6bce81463 (patch) | |
tree | 1d44cd37b6a76424d772914cd515d8af88d87d3b /intern/cycles/util/util_thread.h | |
parent | 93d11edd7e43b6aeb58f3ca6ca9dc92742794a00 (diff) |
Fix Cycles Embree crash on macOS, due to too small thread stack size.
Diffstat (limited to 'intern/cycles/util/util_thread.h')
-rw-r--r-- | intern/cycles/util/util_thread.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/intern/cycles/util/util_thread.h b/intern/cycles/util/util_thread.h index 9ae9af25e6b..793d44130b6 100644 --- a/intern/cycles/util/util_thread.h +++ b/intern/cycles/util/util_thread.h @@ -41,8 +41,8 @@ typedef std::mutex thread_mutex; typedef std::unique_lock<std::mutex> thread_scoped_lock; typedef std::condition_variable thread_condition_variable; -/* own pthread based implementation, to avoid boost version conflicts with - * dynamically loaded blender plugins */ +/* Own thread implementation similar to std::thread, so we can set a + * custom stack size on macOS. */ class thread { public: @@ -56,7 +56,11 @@ public: protected: function<void()> run_cb_; - std::thread thread_; +#ifdef __APPLE__ + pthread_t pthread_id; +#else + std::thread std_thread; +#endif bool joined_; int node_; }; |