Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-11-14 14:21:15 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-11-14 14:21:15 +0300
commit55696b56d98411b6eeadfa1a7349bdb2bca47e38 (patch)
treec50038c221eddeaf68b402f5eabd9b6f5123cec1 /source/blender/blenlib/BLI_threads.h
parent7adc698eedfc325dc8485aa52d56730f87bbb586 (diff)
Fix T53068: AMD Threadripper not working well with Blender
The issue was caused by SpinLock implementation in old pthreads we ar eusing on Windows. Using newer one (2.10-rc) demonstrates same exact behavior. But likely using own atomics and memory barrier based implementation solves the issue. A bit annoying that we need to change such a core part of Blender just to make specific CPU happy, but it's better to have artists happy on all computers. There is no expected downsides of this change, but it is so called "works for me" category. Let's see how it all goes.
Diffstat (limited to 'source/blender/blenlib/BLI_threads.h')
-rw-r--r--source/blender/blenlib/BLI_threads.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h
index 0b1b4d8ee8c..9d672b1ce88 100644
--- a/source/blender/blenlib/BLI_threads.h
+++ b/source/blender/blenlib/BLI_threads.h
@@ -111,8 +111,10 @@ void BLI_mutex_unlock(ThreadMutex *mutex);
/* Spin Lock */
-#ifdef __APPLE__
-typedef OSSpinLock SpinLock;
+#if defined(__APPLE__)
+typedef OSSpinLock ;
+#elif defined(_MSC_VER)
+typedef volatile int SpinLock;
#else
typedef pthread_spinlock_t SpinLock;
#endif