Changeset 19482 for trunk/psModules/src/imcombine/pmSubtraction.c
- Timestamp:
- Sep 10, 2008, 5:37:58 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r19357 r19482 1141 1141 psMutexLock(subMask); 1142 1142 } 1143 psArrayAdd(args, 1, (psImage*)subMask); // Casting away const1143 psArrayAdd(args, 1, subMask); 1144 1144 if (subMask) { 1145 1145 psMutexUnlock(subMask); … … 1166 1166 } 1167 1167 1168 if (!psThreadPoolWait( true)) {1168 if (!psThreadPoolWait(false)) { 1169 1169 psError(PS_ERR_UNKNOWN, false, "Error waiting for threads."); 1170 1170 return false; 1171 1171 } 1172 1172 1173 if (subMask && threaded) { 1174 psMutexDestroy(subMask); 1173 // We don't rely on psThreadPoolWait to harvest the jobs because the job contains a reference to the 1174 // subMask, which is being changed on a thread, and psThreadPoolWait doesn't know that it needs to be 1175 // locked before freeing. After psThreadPoolWait, however, the jobs are completed, the threads are idle, 1176 // and so there's no need to lock the subMask when we're blowing away the jobs. 1177 if (threaded) { 1178 psThreadJob *job; // Completed job 1179 while ((job = psThreadJobGetDone())) { 1180 psFree(job); 1181 } 1182 1183 if (subMask) { 1184 psMutexDestroy(subMask); 1185 } 1175 1186 } 1176 1187
Note:
See TracChangeset
for help on using the changeset viewer.
