Changeset 20834
- Timestamp:
- Nov 25, 2008, 3:22:30 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psThread.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psThread.c
r19297 r20834 254 254 } 255 255 256 // Harvest jobs from the 257 static void psThreadJobHarvest(void) 258 { 259 psThreadLock(); 260 psThreadJob *job; // Job from done queue 261 while ((job = psThreadJobGetDone())) { 262 psFree(job); 263 } 264 psThreadUnlock(); 265 return; 266 } 267 256 268 // call this function after you have added jobs to the queue and 257 269 bool psThreadPoolWait(bool harvest) … … 273 285 // Harvest jobs, if requested 274 286 if (harvest) { 275 psThreadLock(); 276 psThreadJob *job; // Job from done queue 277 while ((job = psThreadJobGetDone())) { 278 psFree(job); 279 } 280 psThreadUnlock(); 287 psThreadJobHarvest(); 281 288 } 282 289 … … 294 301 // Nothing in the queue 295 302 psThreadUnlock(); 303 // Ensure everything is harvested, if requested 304 if (harvest) { 305 psThreadJobHarvest(); 306 } 296 307 return true; 297 308 }
Note:
See TracChangeset
for help on using the changeset viewer.
