IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21351


Ignore:
Timestamp:
Feb 5, 2009, 3:09:38 PM (17 years ago)
Author:
eugene
Message:

comment out the mutex spins on the psImages (now handled by the psImage functions)

Location:
trunk/psModules/src/imcombine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmStackReject.c

    r21183 r21351  
    4343    if (box > 0) {
    4444        // Convolve a subimage, then stick it in the target
    45         if (threaded) {
    46             psMutexLock(source);
    47         }
     45        // XXX if (threaded) {
     46        // XXX     psMutexLock(source);
     47        // XXX }
    4848        psImage *mask = psImageSubset(source, psRegionSet(xMin - box, xMax + box,
    4949                                                          yMin - box, yMax + box)); // Mask to convolve
    50         if (threaded) {
    51             psMutexUnlock(source);
    52         }
     50        // XXX if (threaded) {
     51        // XXX     psMutexUnlock(source);
     52        // XXX }
    5353        psImage *convolved = psImageConvolveMask(NULL, mask, PM_STACK_MASK_BAD, PM_STACK_MASK_CONVOLVE,
    5454                                                 -box, box, -box, box); // Convolved mask
    55         if (threaded) {
    56             psMutexLock(source);
    57         }
     55        // XXX if (threaded) {
     56        // XXX     psMutexLock(source);
     57        // XXX }
    5858        psFree(mask);
    59         if (threaded) {
    60             psMutexUnlock(source);
    61         }
     59        // XXX if (threaded) {
     60        // XXX     psMutexUnlock(source);
     61        // XXX }
    6262
    6363        int numBytes = (xMax - xMin) * PSELEMTYPE_SIZEOF(PS_TYPE_IMAGE_MASK); // Number of bytes to copy
     
    162162    pmReadout *inRO = pmReadoutAlloc(NULL); // Readout with input image
    163163    inRO->image = image;
    164     if (threaded) {
    165         psMutexInit(image);
    166     }
     164    // XXX if (threaded) {
     165    // XXX     psMutexInit(image);
     166    // XXX }
    167167    for (int i = 0; i < numRegions; i++) {
    168168        psRegion *region = subRegions->data[i]; // Region of interest
     
    211211        }
    212212    }
    213     if (threaded) {
    214         psMutexDestroy(image);
    215     }
     213    // XXX if (threaded) {
     214    // XXX     psMutexDestroy(image);
     215    // XXX }
    216216    psFree(inRO);
    217217    psImage *convolved = psMemIncrRefCounter(convRO->image);
     
    264264    psImage *target = psImageRecycle(convolved, numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image
    265265    psImageInit(target, 0);
    266     if (threaded) {
    267         psMutexInit(source);
    268     }
     266    // XXX if (threaded) {
     267    // XXX     psMutexInit(source);
     268    // XXX }
    269269    for (int i = 0; i < subRegions->n; i++) {
    270270        psRegion *region = subRegions->data[i]; // Subtraction region
     
    287287                    psArray *args = job->args; // Job arguments
    288288                    psArrayAdd(args, 1, target);
    289                     psMutexLock(source);
     289                    // XXX psMutexLock(source);
    290290                    psArrayAdd(args, 1, source);
    291                     psMutexUnlock(source);
     291                    // XXX psMutexUnlock(source);
    292292                    psArrayAdd(args, 1, kernels);
    293293                    PS_ARRAY_ADD_SCALAR(args, numCols, PS_TYPE_S32);
     
    332332        }
    333333
    334         psMutexDestroy(source);
     334        // XXX psMutexDestroy(source);
    335335    }
    336336
  • trunk/psModules/src/imcombine/pmSubtraction.c

    r21183 r21351  
    213213        return NULL;
    214214    }
    215     if (threaded) {
    216         psMutexLock(image);
    217     }
     215    // XXX if (threaded) {
     216    // XXX     psMutexLock(image);
     217    // XXX }
    218218    psImage *subset = psImageSubset(image, region); // Subset image, to return
    219     if (threaded) {
    220         psMutexUnlock(image);
    221     }
     219    // XXX if (threaded) {
     220    // XXX     psMutexUnlock(image);
     221    // XXX }
    222222    return subset;
    223223}
     
    232232        return;
    233233    }
    234     if (threaded) {
    235         psMutexLock(parent);
    236     }
     234    // XXX if (threaded) {
     235    // XXX     psMutexLock(parent);
     236    // XXX }
    237237    psFree(child);
    238     if (threaded) {
    239         psMutexUnlock(parent);
    240     }
     238    // XXX if (threaded) {
     239    // XXX     psMutexUnlock(parent);
     240    // XXX }
    241241    return;
    242242}
     
    11441144        if (!out1->image) {
    11451145            out1->image = psImageAlloc(numCols, numRows, PS_TYPE_F32);
    1146             if (threaded) {
    1147                 psMutexInit(out1->image);
    1148             }
     1146            // XXX if (threaded) {
     1147            // XXX     psMutexInit(out1->image);
     1148            // XXX }
    11491149        }
    11501150        if (ro1->weight) {
    11511151            if (!out1->weight) {
    11521152                out1->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32);
    1153                 if (threaded) {
    1154                     psMutexInit(out1->weight);
    1155                 }
     1153                // XXX if (threaded) {
     1154                // XXX     psMutexInit(out1->weight);
     1155                // XXX }
    11561156            }
    11571157            psImageInit(out1->weight, 0.0);
     
    11611161        if (!out2->image) {
    11621162            out2->image = psImageAlloc(numCols, numRows, PS_TYPE_F32);
    1163             if (threaded) {
    1164                 psMutexInit(out2->image);
    1165             }
     1163            // XXX if (threaded) {
     1164            // XXX     psMutexInit(out2->image);
     1165            // XXX }
    11661166        }
    11671167        if (ro2->weight) {
    11681168            if (!out2->weight) {
    11691169                out2->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32);
    1170                 if (threaded) {
    1171                     psMutexInit(out2->weight);
    1172                 }
     1170                // XXX if (threaded) {
     1171                // XXX     psMutexInit(out2->weight);
     1172                // XXX }
    11731173            }
    11741174            psImageInit(out2->weight, 0.0);
     
    11771177    psImage *convMask = NULL;           // Convolved mask image (common to inputs 1 and 2)
    11781178    if (subMask) {
    1179         if (threaded) {
    1180             psMutexInit(subMask);
    1181         }
     1179        // XXX if (threaded) {
     1180        // XXX     psMutexInit(subMask);
     1181        // XXX }
    11821182        if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) {
    11831183            if (!out1->mask) {
     
    12051205    if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) {
    12061206        sys1 = subtractionSysErrImage(ro1->image, sysError);
    1207         if (threaded && sys1) {
    1208             psMutexInit(sys1);
    1209         }
     1207        // XXX if (threaded && sys1) {
     1208        // XXX     psMutexInit(sys1);
     1209        // XXX }
    12101210    }
    12111211    if (kernels->mode == PM_SUBTRACTION_MODE_2 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) {
    12121212        sys2 = subtractionSysErrImage(ro2->image, sysError);
    1213         if (threaded && sys2) {
    1214             psMutexInit(sys2);
    1215         }
     1213        // XXX if (threaded && sys2) {
     1214        // XXX     psMutexInit(sys2);
     1215        // XXX }
    12161216    }
    12171217
     
    12641264                psArrayAdd(args, 1, (pmReadout*)ro2); // Casting away const
    12651265                // Since adding to the array can impact the reference count, we need to lock
    1266                 if (sys1) {
    1267                     psMutexLock(sys1);
    1268                 }
     1266                // XXX if (sys1) {
     1267                // XXX     psMutexLock(sys1);
     1268                // XXX }
    12691269                psArrayAdd(args, 1, sys1);
    1270                 if (sys1) {
    1271                     psMutexUnlock(sys1);
    1272                 }
    1273                 if (sys2) {
    1274                     psMutexLock(sys2);
    1275                 }
     1270                // XXX if (sys1) {
     1271                // XXX     psMutexUnlock(sys1);
     1272                // XXX }
     1273                // XXX if (sys2) {
     1274                // XXX     psMutexLock(sys2);
     1275                // XXX }
    12761276                psArrayAdd(args, 1, sys2);
    1277                 if (sys2) {
    1278                     psMutexUnlock(sys2);
    1279                 }
    1280                 if (subMask) {
    1281                     psMutexLock(subMask);
    1282                 }
     1277                // XXX if (sys2) {
     1278                // XXX     psMutexUnlock(sys2);
     1279                // XXX }
     1280                // XXX if (subMask) {
     1281                // XXX     psMutexLock(subMask);
     1282                // XXX }
    12831283                psArrayAdd(args, 1, subMask);
    1284                 if (subMask) {
    1285                     psMutexUnlock(subMask);
    1286                 }
     1284                // XXX if (subMask) {
     1285                // XXX     psMutexUnlock(subMask);
     1286                // XXX }
    12871287                PS_ARRAY_ADD_SCALAR(args, maskBad, PS_TYPE_IMAGE_MASK);
    12881288                PS_ARRAY_ADD_SCALAR(args, maskPoor, PS_TYPE_IMAGE_MASK);
     
    13241324        }
    13251325
    1326         if (subMask) {
    1327             psMutexDestroy(subMask);
    1328         }
    1329         if (sys1) {
    1330             psMutexDestroy(sys1);
    1331         }
    1332         if (sys2) {
    1333             psMutexDestroy(sys2);
    1334         }
     1326        // XXX if (subMask) {
     1327        // XXX     psMutexDestroy(subMask);
     1328        // XXX }
     1329        // XXX if (sys1) {
     1330        // XXX     psMutexDestroy(sys1);
     1331        // XXX }
     1332        // XXX if (sys2) {
     1333        // XXX     psMutexDestroy(sys2);
     1334        // XXX }
    13351335    }
    13361336
  • trunk/psModules/src/imcombine/pmSubtractionThreads.c

    r19765 r21351  
    2424    }
    2525
    26     if (ro->image) {
    27         psMutexInit(ro->image);
    28     }
    29     if (ro->weight) {
    30         psMutexInit(ro->weight);
    31     }
     26    // XXX if (ro->image) {
     27    // XXX     psMutexInit(ro->image);
     28    // XXX }
     29    // XXX if (ro->weight) {
     30    // XXX     psMutexInit(ro->weight);
     31    // XXX }
    3232
    3333    return;
     
    4040    }
    4141
    42     if (ro->image) {
    43         psMutexDestroy(ro->image);
    44     }
    45     if (ro->weight) {
    46         psMutexDestroy(ro->weight);
    47     }
     42    // XXX if (ro->image) {
     43    // XXX     psMutexDestroy(ro->image);
     44    // XXX }
     45    // XXX if (ro->weight) {
     46    // XXX     psMutexDestroy(ro->weight);
     47    // XXX }
    4848
    4949    return;
Note: See TracChangeset for help on using the changeset viewer.