[Bf-blender-cvs] [9ca5945934a] cycles_embree: Revert "Cycles: Raised thread stack size to 1MB for macOS to be consistent with Windows."

Stefan Werner noreply at git.blender.org
Thu Aug 2 16:04:22 CEST 2018


Commit: 9ca5945934a9620aaa0672dfceaa63d513796000
Author: Stefan Werner
Date:   Thu Aug 2 15:33:16 2018 +0200
Branches: cycles_embree
https://developer.blender.org/rB9ca5945934a9620aaa0672dfceaa63d513796000

Revert "Cycles: Raised thread stack size to 1MB for macOS to be consistent with Windows."

This reverts commit 151b5a9a1e568476c6886709b460edbf0936f7f7.

===================================================================

M	intern/cycles/util/util_thread.cpp
M	intern/cycles/util/util_thread.h

===================================================================

diff --git a/intern/cycles/util/util_thread.cpp b/intern/cycles/util/util_thread.cpp
index 9ab43284074..c66aa484264 100644
--- a/intern/cycles/util/util_thread.cpp
+++ b/intern/cycles/util/util_thread.cpp
@@ -26,19 +26,10 @@ thread::thread(function<void(void)> run_cb, int group)
     joined_(false),
 	group_(group)
 {
-#ifdef CYCLES_USE_STD_THREAD
+#if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
 	thread_ = std::thread(&thread::run, this);
 #else
-# ifdef __APPLE__
-	/* Set the stack size to 1MB to match other platforms.
-	 * The default of 512kB may be to small. */
-	pthread_attr_t attribute;
-	pthread_attr_init(&attribute);
-	pthread_attr_setstacksize(&attribute,1024*1024*1);
-	pthread_create(&pthread_id_, &attribute, run, (void*)this);
-#  else
 	pthread_create(&pthread_id_, NULL, run, (void*)this);
-#  endif
 #endif
 }
 
@@ -73,7 +64,7 @@ void *thread::run(void *arg)
 bool thread::join()
 {
 	joined_ = true;
-#ifdef CYCLES_USE_STD_THREAD
+#if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
 	try {
 		thread_.join();
 		return true;
diff --git a/intern/cycles/util/util_thread.h b/intern/cycles/util/util_thread.h
index 2972199398b..77b51d37ea0 100644
--- a/intern/cycles/util/util_thread.h
+++ b/intern/cycles/util/util_thread.h
@@ -18,12 +18,6 @@
 #define __UTIL_THREAD_H__
 
 #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
-#if !defined(__APPLE__)
-#  define CYCLES_USE_STD_THREAD
-#endif
-#endif
-
-#ifdef CYCLES_USE_STD_THREAD
 #  include <thread>
 #  include <mutex>
 #  include <condition_variable>
@@ -48,7 +42,7 @@
 
 CCL_NAMESPACE_BEGIN
 
-#ifdef CYCLES_USE_STD_THREAD
+#if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
 typedef std::mutex thread_mutex;
 typedef std::unique_lock<std::mutex> thread_scoped_lock;
 typedef std::condition_variable thread_condition_variable;
@@ -72,7 +66,7 @@ public:
 
 protected:
 	function<void(void)> run_cb_;
-#ifdef CYCLES_USE_STD_THREAD
+#if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
 	std::thread thread_;
 #else
 	pthread_t pthread_id_;



More information about the Bf-blender-cvs mailing list