Changeset 21300
- Timestamp:
- Feb 4, 2009, 3:42:27 PM (17 years ago)
- Location:
- branches/eam_branch_20090203/psModules/src/imcombine
- Files:
-
- 3 edited
-
pmStackReject.c (modified) (6 diffs)
-
pmSubtraction.c (modified) (8 diffs)
-
pmSubtractionThreads.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20090203/psModules/src/imcombine/pmStackReject.c
r21183 r21300 43 43 if (box > 0) { 44 44 // 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 } 48 48 psImage *mask = psImageSubset(source, psRegionSet(xMin - box, xMax + box, 49 49 yMin - box, yMax + box)); // Mask to convolve 50 if (threaded) {51 psMutexUnlock(source);52 }50 // XXX if (threaded) { 51 // XXX psMutexUnlock(source); 52 // XXX } 53 53 psImage *convolved = psImageConvolveMask(NULL, mask, PM_STACK_MASK_BAD, PM_STACK_MASK_CONVOLVE, 54 54 -box, box, -box, box); // Convolved mask 55 if (threaded) {56 psMutexLock(source);57 }55 // XXX if (threaded) { 56 // XXX psMutexLock(source); 57 // XXX } 58 58 psFree(mask); 59 if (threaded) {60 psMutexUnlock(source);61 }59 // XXX if (threaded) { 60 // XXX psMutexUnlock(source); 61 // XXX } 62 62 63 63 int numBytes = (xMax - xMin) * PSELEMTYPE_SIZEOF(PS_TYPE_IMAGE_MASK); // Number of bytes to copy … … 162 162 pmReadout *inRO = pmReadoutAlloc(NULL); // Readout with input image 163 163 inRO->image = image; 164 if (threaded) {165 psMutexInit(image);166 }164 // XXX if (threaded) { 165 // XXX psMutexInit(image); 166 // XXX } 167 167 for (int i = 0; i < numRegions; i++) { 168 168 psRegion *region = subRegions->data[i]; // Region of interest … … 211 211 } 212 212 } 213 if (threaded) {214 psMutexDestroy(image);215 }213 // XXX if (threaded) { 214 // XXX psMutexDestroy(image); 215 // XXX } 216 216 psFree(inRO); 217 217 psImage *convolved = psMemIncrRefCounter(convRO->image); … … 264 264 psImage *target = psImageRecycle(convolved, numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image 265 265 psImageInit(target, 0); 266 if (threaded) {267 psMutexInit(source);268 }266 // XXX if (threaded) { 267 // XXX psMutexInit(source); 268 // XXX } 269 269 for (int i = 0; i < subRegions->n; i++) { 270 270 psRegion *region = subRegions->data[i]; // Subtraction region … … 287 287 psArray *args = job->args; // Job arguments 288 288 psArrayAdd(args, 1, target); 289 psMutexLock(source);289 // XXX psMutexLock(source); 290 290 psArrayAdd(args, 1, source); 291 psMutexUnlock(source);291 // XXX psMutexUnlock(source); 292 292 psArrayAdd(args, 1, kernels); 293 293 PS_ARRAY_ADD_SCALAR(args, numCols, PS_TYPE_S32); … … 332 332 } 333 333 334 psMutexDestroy(source);334 // XXX psMutexDestroy(source); 335 335 } 336 336 -
branches/eam_branch_20090203/psModules/src/imcombine/pmSubtraction.c
r21183 r21300 213 213 return NULL; 214 214 } 215 if (threaded) {216 psMutexLock(image);217 }215 // XXX if (threaded) { 216 // XXX psMutexLock(image); 217 // XXX } 218 218 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 } 222 222 return subset; 223 223 } … … 232 232 return; 233 233 } 234 if (threaded) {235 psMutexLock(parent);236 }234 // XXX if (threaded) { 235 // XXX psMutexLock(parent); 236 // XXX } 237 237 psFree(child); 238 if (threaded) {239 psMutexUnlock(parent);240 }238 // XXX if (threaded) { 239 // XXX psMutexUnlock(parent); 240 // XXX } 241 241 return; 242 242 } … … 1144 1144 if (!out1->image) { 1145 1145 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 } 1149 1149 } 1150 1150 if (ro1->weight) { 1151 1151 if (!out1->weight) { 1152 1152 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 } 1156 1156 } 1157 1157 psImageInit(out1->weight, 0.0); … … 1161 1161 if (!out2->image) { 1162 1162 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 } 1166 1166 } 1167 1167 if (ro2->weight) { 1168 1168 if (!out2->weight) { 1169 1169 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 } 1173 1173 } 1174 1174 psImageInit(out2->weight, 0.0); … … 1177 1177 psImage *convMask = NULL; // Convolved mask image (common to inputs 1 and 2) 1178 1178 if (subMask) { 1179 if (threaded) {1180 psMutexInit(subMask);1181 }1179 // XXX if (threaded) { 1180 // XXX psMutexInit(subMask); 1181 // XXX } 1182 1182 if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) { 1183 1183 if (!out1->mask) { … … 1205 1205 if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) { 1206 1206 sys1 = subtractionSysErrImage(ro1->image, sysError); 1207 if (threaded && sys1) {1208 psMutexInit(sys1);1209 }1207 // XXX if (threaded && sys1) { 1208 // XXX psMutexInit(sys1); 1209 // XXX } 1210 1210 } 1211 1211 if (kernels->mode == PM_SUBTRACTION_MODE_2 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) { 1212 1212 sys2 = subtractionSysErrImage(ro2->image, sysError); 1213 if (threaded && sys2) {1214 psMutexInit(sys2);1215 }1213 // XXX if (threaded && sys2) { 1214 // XXX psMutexInit(sys2); 1215 // XXX } 1216 1216 } 1217 1217 … … 1264 1264 psArrayAdd(args, 1, (pmReadout*)ro2); // Casting away const 1265 1265 // 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 } 1269 1269 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 } 1276 1276 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 } 1283 1283 psArrayAdd(args, 1, subMask); 1284 if (subMask) {1285 psMutexUnlock(subMask);1286 }1284 // XXX if (subMask) { 1285 // XXX psMutexUnlock(subMask); 1286 // XXX } 1287 1287 PS_ARRAY_ADD_SCALAR(args, maskBad, PS_TYPE_IMAGE_MASK); 1288 1288 PS_ARRAY_ADD_SCALAR(args, maskPoor, PS_TYPE_IMAGE_MASK); … … 1324 1324 } 1325 1325 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 } 1335 1335 } 1336 1336 -
branches/eam_branch_20090203/psModules/src/imcombine/pmSubtractionThreads.c
r19765 r21300 24 24 } 25 25 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 } 32 32 33 33 return; … … 40 40 } 41 41 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 } 48 48 49 49 return;
Note:
See TracChangeset
for help on using the changeset viewer.
