Index: /trunk/psLib/src/imageops/psImageConvolve.c
===================================================================
--- /trunk/psLib/src/imageops/psImageConvolve.c	(revision 27907)
+++ /trunk/psLib/src/imageops/psImageConvolve.c	(revision 27908)
@@ -37,7 +37,7 @@
 
 
+
 static bool threaded = false;           // Run image convolution threaded?
-
-
+static pthread_mutex_t threadMutex = PTHREAD_MUTEX_INITIALIZER;
 
 
@@ -1679,4 +1679,5 @@
 bool psImageConvolveSetThreads(bool set)
 {
+    psMutexLock(threadMutex);
     bool old = threaded;                // Old value
     if (set && !threaded) {
@@ -1711,4 +1712,5 @@
     }
     threaded = set;
+    psMutexUnlock(threadMutex);
     return old;
 }
