Changeset 37677
- Timestamp:
- Nov 26, 2014, 7:46:26 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/relastro
- Files:
-
- 3 edited
-
include/relastro.h (modified) (1 diff)
-
src/FitChip.c (modified) (1 diff)
-
src/UpdateChips.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h
r37665 r37677 655 655 656 656 int HarvestRegionHosts (RegionHostTable *regionHosts); 657 658 void lockUpdateChips (); 659 void unlockUpdateChips (); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FitChip.c
r37646 r37677 115 115 if (image[0].coords.offsetMap == NULL) { 116 116 // allocate a new table and assign to this image 117 // need to lock threads here because 'table' is a static with 118 // modifiable elements 119 lockUpdateChips (); 117 120 AstromOffsetTable *table = get_astrom_table (); 118 121 AstromOffsetTableNewMap(table, order_use, image); 122 unlockUpdateChips (); 119 123 } 120 124 fit_map (image[0].coords.offsetMap, raw, ref, Nmatch); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c
r37649 r37677 354 354 static pthread_mutex_t UpdateChips_mutex = PTHREAD_MUTEX_INITIALIZER; 355 355 356 void lockUpdateChips () { 357 pthread_mutex_lock (&UpdateChips_mutex); 358 } 359 void unlockUpdateChips () { 360 pthread_mutex_unlock (&UpdateChips_mutex); 361 } 362 356 363 // we have an array of chips (image, Nimage). we need to hand out images one at a time to 357 364 // the worker threads as they need 358 365 off_t getNextImageForThread () { 359 366 360 pthread_mutex_lock (&UpdateChips_mutex);367 lockUpdateChips (); 361 368 if (nextImage >= Nimage) { 362 pthread_mutex_unlock (&UpdateChips_mutex);369 unlockUpdateChips (); 363 370 return (-1); 364 371 } … … 366 373 nextImage ++; 367 374 368 pthread_mutex_unlock (&UpdateChips_mutex);375 unlockUpdateChips (); 369 376 return (thisImage); 370 377 }
Note:
See TracChangeset
for help on using the changeset viewer.
