From 637bc0ddea8b7badf7231075e34b0a8ef5aa7c36 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 4 Feb 2012 11:10:41 +0000 Subject: Code Cleanup: pep8 edits --- intern/cycles/blender/addon/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index c82ab9ce624..c966792ed29 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -370,7 +370,7 @@ class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel): visibility = ob.cycles_visibility flow = layout.column_flow() - + flow.prop(visibility, "camera") flow.prop(visibility, "diffuse") flow.prop(visibility, "glossy") -- cgit v1.2.3 From 5c395b69f55560e20c4c1f3e972b8e0759c647c2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 4 Feb 2012 19:58:09 +0000 Subject: Fix for Luxrender boost::thread conflict, workaround now is to just not use it in cycles and use pthreads instead. --- intern/cycles/SConscript | 3 +++ intern/cycles/util/util_thread.h | 51 ++++++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 13 deletions(-) (limited to 'intern') diff --git a/intern/cycles/SConscript b/intern/cycles/SConscript index bc9eb563e50..2ea224f052d 100644 --- a/intern/cycles/SConscript +++ b/intern/cycles/SConscript @@ -39,6 +39,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): else: cxxflags.append('-ffast-math'.split()) +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): + incs.append(env['BF_PTHREADS_INC']) + # optimized kernel if env['WITH_BF_RAYOPTIMIZATION']: optim_cxxflags = [] diff --git a/intern/cycles/util/util_thread.h b/intern/cycles/util/util_thread.h index ad95f04b4f9..6836be203f5 100644 --- a/intern/cycles/util/util_thread.h +++ b/intern/cycles/util/util_thread.h @@ -20,29 +20,54 @@ #define __UTIL_THREAD_H__ #include +#include #include +#include "util_function.h" + CCL_NAMESPACE_BEGIN -#if 0 +/* use boost for mutexes */ -/* Use STL for threading */ +typedef boost::mutex thread_mutex; +typedef boost::mutex::scoped_lock thread_scoped_lock; +typedef boost::condition_variable thread_condition_variable; -using std::thread; -using std::thread_mutex; -typedef std::lock_guard thread_scoped_lock; -using std::condition_variable; +/* own pthread based implementation, to avoid boost version conflicts with + dynamically loaded blender plugins */ -#else +class thread { +public: + thread(boost::function run_cb_) + { + joined = false; + run_cb = run_cb_; -/* Use boost for threading */ + pthread_create(&pthread_id, NULL, run, (void*)this); + } -using boost::thread; -typedef boost::mutex thread_mutex; -typedef boost::mutex::scoped_lock thread_scoped_lock; -typedef boost::condition_variable thread_condition_variable; + ~thread() + { + if(!joined) + join(); + } -#endif + static void *run(void *arg) + { + ((thread*)arg)->run_cb();; + return NULL; + } + + bool join() + { + return pthread_join(pthread_id, NULL) == 0; + } + +protected: + boost::function run_cb; + pthread_t pthread_id; + bool joined; +}; /* Thread Safe Queue to pass tasks from one thread to another. Tasks should be * pushed into the queue, while the worker thread waits to pop the next task -- cgit v1.2.3