Index: /branches/eam_branch_20090203/psModules/src/imcombine/pmStackReject.c
===================================================================
--- /branches/eam_branch_20090203/psModules/src/imcombine/pmStackReject.c	(revision 21299)
+++ /branches/eam_branch_20090203/psModules/src/imcombine/pmStackReject.c	(revision 21300)
@@ -43,21 +43,21 @@
     if (box > 0) {
         // Convolve a subimage, then stick it in the target
-        if (threaded) {
-            psMutexLock(source);
-        }
+        // XXX if (threaded) {
+        // XXX     psMutexLock(source);
+        // XXX }
         psImage *mask = psImageSubset(source, psRegionSet(xMin - box, xMax + box,
                                                           yMin - box, yMax + box)); // Mask to convolve
-        if (threaded) {
-            psMutexUnlock(source);
-        }
+        // XXX if (threaded) {
+        // XXX     psMutexUnlock(source);
+        // XXX }
         psImage *convolved = psImageConvolveMask(NULL, mask, PM_STACK_MASK_BAD, PM_STACK_MASK_CONVOLVE,
                                                  -box, box, -box, box); // Convolved mask
-        if (threaded) {
-            psMutexLock(source);
-        }
+        // XXX if (threaded) {
+        // XXX     psMutexLock(source);
+        // XXX }
         psFree(mask);
-        if (threaded) {
-            psMutexUnlock(source);
-        }
+        // XXX if (threaded) {
+        // XXX     psMutexUnlock(source);
+        // XXX }
 
         int numBytes = (xMax - xMin) * PSELEMTYPE_SIZEOF(PS_TYPE_IMAGE_MASK); // Number of bytes to copy
@@ -162,7 +162,7 @@
     pmReadout *inRO = pmReadoutAlloc(NULL); // Readout with input image
     inRO->image = image;
-    if (threaded) {
-        psMutexInit(image);
-    }
+    // XXX if (threaded) {
+    // XXX     psMutexInit(image);
+    // XXX }
     for (int i = 0; i < numRegions; i++) {
         psRegion *region = subRegions->data[i]; // Region of interest
@@ -211,7 +211,7 @@
         }
     }
-    if (threaded) {
-        psMutexDestroy(image);
-    }
+    // XXX if (threaded) {
+    // XXX     psMutexDestroy(image);
+    // XXX }
     psFree(inRO);
     psImage *convolved = psMemIncrRefCounter(convRO->image);
@@ -264,7 +264,7 @@
     psImage *target = psImageRecycle(convolved, numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image
     psImageInit(target, 0);
-    if (threaded) {
-        psMutexInit(source);
-    }
+    // XXX if (threaded) {
+    // XXX     psMutexInit(source);
+    // XXX }
     for (int i = 0; i < subRegions->n; i++) {
         psRegion *region = subRegions->data[i]; // Subtraction region
@@ -287,7 +287,7 @@
                     psArray *args = job->args; // Job arguments
                     psArrayAdd(args, 1, target);
-                    psMutexLock(source);
+                    // XXX psMutexLock(source);
                     psArrayAdd(args, 1, source);
-                    psMutexUnlock(source);
+                    // XXX psMutexUnlock(source);
                     psArrayAdd(args, 1, kernels);
                     PS_ARRAY_ADD_SCALAR(args, numCols, PS_TYPE_S32);
@@ -332,5 +332,5 @@
         }
 
-        psMutexDestroy(source);
+        // XXX psMutexDestroy(source);
     }
 
Index: /branches/eam_branch_20090203/psModules/src/imcombine/pmSubtraction.c
===================================================================
--- /branches/eam_branch_20090203/psModules/src/imcombine/pmSubtraction.c	(revision 21299)
+++ /branches/eam_branch_20090203/psModules/src/imcombine/pmSubtraction.c	(revision 21300)
@@ -213,11 +213,11 @@
         return NULL;
     }
-    if (threaded) {
-        psMutexLock(image);
-    }
+    // XXX if (threaded) {
+    // XXX     psMutexLock(image);
+    // XXX }
     psImage *subset = psImageSubset(image, region); // Subset image, to return
-    if (threaded) {
-        psMutexUnlock(image);
-    }
+    // XXX if (threaded) {
+    // XXX     psMutexUnlock(image);
+    // XXX }
     return subset;
 }
@@ -232,11 +232,11 @@
         return;
     }
-    if (threaded) {
-        psMutexLock(parent);
-    }
+    // XXX if (threaded) {
+    // XXX     psMutexLock(parent);
+    // XXX }
     psFree(child);
-    if (threaded) {
-        psMutexUnlock(parent);
-    }
+    // XXX if (threaded) {
+    // XXX     psMutexUnlock(parent);
+    // XXX }
     return;
 }
@@ -1144,14 +1144,14 @@
         if (!out1->image) {
             out1->image = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-            if (threaded) {
-                psMutexInit(out1->image);
-            }
+            // XXX if (threaded) {
+            // XXX     psMutexInit(out1->image);
+            // XXX }
         }
         if (ro1->weight) {
             if (!out1->weight) {
                 out1->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-                if (threaded) {
-                    psMutexInit(out1->weight);
-                }
+                // XXX if (threaded) {
+                // XXX     psMutexInit(out1->weight);
+                // XXX }
             }
             psImageInit(out1->weight, 0.0);
@@ -1161,14 +1161,14 @@
         if (!out2->image) {
             out2->image = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-            if (threaded) {
-                psMutexInit(out2->image);
-            }
+            // XXX if (threaded) {
+            // XXX     psMutexInit(out2->image);
+            // XXX }
         }
         if (ro2->weight) {
             if (!out2->weight) {
                 out2->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-                if (threaded) {
-                    psMutexInit(out2->weight);
-                }
+                // XXX if (threaded) {
+                // XXX     psMutexInit(out2->weight);
+                // XXX }
             }
             psImageInit(out2->weight, 0.0);
@@ -1177,7 +1177,7 @@
     psImage *convMask = NULL;           // Convolved mask image (common to inputs 1 and 2)
     if (subMask) {
-        if (threaded) {
-            psMutexInit(subMask);
-        }
+        // XXX if (threaded) {
+        // XXX     psMutexInit(subMask);
+        // XXX }
         if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) {
             if (!out1->mask) {
@@ -1205,13 +1205,13 @@
     if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) {
         sys1 = subtractionSysErrImage(ro1->image, sysError);
-        if (threaded && sys1) {
-            psMutexInit(sys1);
-        }
+        // XXX if (threaded && sys1) {
+        // XXX     psMutexInit(sys1);
+        // XXX }
     }
     if (kernels->mode == PM_SUBTRACTION_MODE_2 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) {
         sys2 = subtractionSysErrImage(ro2->image, sysError);
-        if (threaded && sys2) {
-            psMutexInit(sys2);
-        }
+        // XXX if (threaded && sys2) {
+        // XXX     psMutexInit(sys2);
+        // XXX }
     }
 
@@ -1264,25 +1264,25 @@
                 psArrayAdd(args, 1, (pmReadout*)ro2); // Casting away const
                 // Since adding to the array can impact the reference count, we need to lock
-                if (sys1) {
-                    psMutexLock(sys1);
-                }
+                // XXX if (sys1) {
+                // XXX     psMutexLock(sys1);
+                // XXX }
                 psArrayAdd(args, 1, sys1);
-                if (sys1) {
-                    psMutexUnlock(sys1);
-                }
-                if (sys2) {
-                    psMutexLock(sys2);
-                }
+                // XXX if (sys1) {
+                // XXX     psMutexUnlock(sys1);
+                // XXX }
+                // XXX if (sys2) {
+                // XXX     psMutexLock(sys2);
+                // XXX }
                 psArrayAdd(args, 1, sys2);
-                if (sys2) {
-                    psMutexUnlock(sys2);
-                }
-                if (subMask) {
-                    psMutexLock(subMask);
-                }
+                // XXX if (sys2) {
+                // XXX     psMutexUnlock(sys2);
+                // XXX }
+                // XXX if (subMask) {
+                // XXX     psMutexLock(subMask);
+                // XXX }
                 psArrayAdd(args, 1, subMask);
-                if (subMask) {
-                    psMutexUnlock(subMask);
-                }
+                // XXX if (subMask) {
+                // XXX     psMutexUnlock(subMask);
+                // XXX }
                 PS_ARRAY_ADD_SCALAR(args, maskBad, PS_TYPE_IMAGE_MASK);
                 PS_ARRAY_ADD_SCALAR(args, maskPoor, PS_TYPE_IMAGE_MASK);
@@ -1324,13 +1324,13 @@
         }
 
-        if (subMask) {
-            psMutexDestroy(subMask);
-        }
-        if (sys1) {
-            psMutexDestroy(sys1);
-        }
-        if (sys2) {
-            psMutexDestroy(sys2);
-        }
+        // XXX if (subMask) {
+        // XXX     psMutexDestroy(subMask);
+        // XXX }
+        // XXX if (sys1) {
+        // XXX     psMutexDestroy(sys1);
+        // XXX }
+        // XXX if (sys2) {
+        // XXX     psMutexDestroy(sys2);
+        // XXX }
     }
 
Index: /branches/eam_branch_20090203/psModules/src/imcombine/pmSubtractionThreads.c
===================================================================
--- /branches/eam_branch_20090203/psModules/src/imcombine/pmSubtractionThreads.c	(revision 21299)
+++ /branches/eam_branch_20090203/psModules/src/imcombine/pmSubtractionThreads.c	(revision 21300)
@@ -24,10 +24,10 @@
     }
 
-    if (ro->image) {
-        psMutexInit(ro->image);
-    }
-    if (ro->weight) {
-        psMutexInit(ro->weight);
-    }
+    // XXX if (ro->image) {
+    // XXX     psMutexInit(ro->image);
+    // XXX }
+    // XXX if (ro->weight) {
+    // XXX     psMutexInit(ro->weight);
+    // XXX }
 
     return;
@@ -40,10 +40,10 @@
     }
 
-    if (ro->image) {
-        psMutexDestroy(ro->image);
-    }
-    if (ro->weight) {
-        psMutexDestroy(ro->weight);
-    }
+    // XXX if (ro->image) {
+    // XXX     psMutexDestroy(ro->image);
+    // XXX }
+    // XXX if (ro->weight) {
+    // XXX     psMutexDestroy(ro->weight);
+    // XXX }
 
     return;
