IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 10, 2008, 5:37:58 PM (18 years ago)
Author:
Paul Price
Message:

Merging in pap_branch_080908. Was originally going to use it for making stamps tolerant of masked pixels, but that's no longer necessary.

File:
1 edited

Legend:

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

    r19357 r19482  
    11411141                    psMutexLock(subMask);
    11421142                }
    1143                 psArrayAdd(args, 1, (psImage*)subMask); // Casting away const
     1143                psArrayAdd(args, 1, subMask);
    11441144                if (subMask) {
    11451145                    psMutexUnlock(subMask);
     
    11661166    }
    11671167
    1168     if (!psThreadPoolWait(true)) {
     1168    if (!psThreadPoolWait(false)) {
    11691169        psError(PS_ERR_UNKNOWN, false, "Error waiting for threads.");
    11701170        return false;
    11711171    }
    11721172
    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        }
    11751186    }
    11761187
Note: See TracChangeset for help on using the changeset viewer.