Changeset 21347 for trunk/psLib/src/imageops/psImageStructManip.c
- Timestamp:
- Feb 5, 2009, 3:05:58 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageStructManip.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageStructManip.c
r15492 r21347 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $11 * @date $Date: 200 7-11-08 01:09:48 $10 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2009-02-06 01:05:58 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 21 21 #include <string.h> 22 22 #include <assert.h> 23 #include <errno.h> 23 24 24 25 #include "psMemory.h" 25 26 #include "psError.h" 26 27 #include "psAbort.h" 28 #include "psTrace.h" 27 29 28 30 #include "psImageStructManip.h" … … 108 110 109 111 // drop my entry on my parent's array of children 112 psMutexLock (out); 110 113 psArrayRemoveDataNoFree (out->parent->children, out); 114 psMutexUnlock (out); 111 115 112 116 // drop my reference to my old parent … … 119 123 out = p_psAlloc(file, lineno, func, sizeof(psImage)); 120 124 out->data.V = NULL; 125 psMutexInit (out); 121 126 } 122 127 … … 129 134 P_PSIMAGE_SET_ROW0(out, row0); 130 135 136 // As long as I have a valid image reference, no one else can free it to zero (I have at 137 // least the last reference) 131 138 out->parent = psMemIncrRefCounter(image); // track references to parents 132 139 out->children = NULL; … … 144 151 } 145 152 146 // add output image as a child of the input image. 153 // Add output image as a child of the input image. Lock image before performing this 154 // operation (psArrayAdd is NOT thread-safe) 155 psMutexLock (image); 147 156 image->children = p_psArrayAdd(file, lineno, func, image->children, 16, out); 157 psMutexUnlock (image); 158 148 159 psFree (out); // the image->children array is an array of views only 149 150 160 return (out); 151 161 } … … 369 379 P_PSIMAGE_SET_NUMROWS(image, numRows); 370 380 371 // XXX: should I really resize the buffers?381 // resize the buffers to the new image size 372 382 image->data.V = psRealloc(image->data.V,sizeof(psPtr)*numRows); 373 383 image->p_rawDataBuffer = psRealloc(image->p_rawDataBuffer,rowSize*numRows);
Note:
See TracChangeset
for help on using the changeset viewer.
