Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h	(revision 37676)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h	(revision 37677)
@@ -655,2 +655,5 @@
 
 int HarvestRegionHosts (RegionHostTable *regionHosts);
+
+void lockUpdateChips ();
+void unlockUpdateChips ();
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FitChip.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FitChip.c	(revision 37676)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FitChip.c	(revision 37677)
@@ -115,6 +115,10 @@
       if (image[0].coords.offsetMap == NULL) {
 	// allocate a new table and assign to this image
+	// need to lock threads here because 'table' is a static with 
+	// modifiable elements
+	lockUpdateChips ();
 	AstromOffsetTable *table = get_astrom_table ();
 	AstromOffsetTableNewMap(table, order_use, image);
+	unlockUpdateChips ();
       }
       fit_map (image[0].coords.offsetMap, raw, ref, Nmatch);
Index: /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c	(revision 37676)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c	(revision 37677)
@@ -354,11 +354,18 @@
 static pthread_mutex_t UpdateChips_mutex = PTHREAD_MUTEX_INITIALIZER;
 
+void lockUpdateChips () {
+  pthread_mutex_lock (&UpdateChips_mutex);
+}
+void unlockUpdateChips () {
+  pthread_mutex_unlock (&UpdateChips_mutex);
+}
+
 // we have an array of chips (image, Nimage).  we need to hand out images one at a time to
 // the worker threads as they need
 off_t getNextImageForThread () {
 
-  pthread_mutex_lock (&UpdateChips_mutex);
+  lockUpdateChips ();
   if (nextImage >= Nimage) {
-    pthread_mutex_unlock (&UpdateChips_mutex);
+    unlockUpdateChips ();
     return (-1);
   }
@@ -366,5 +373,5 @@
   nextImage ++;
 
-  pthread_mutex_unlock (&UpdateChips_mutex);
+  unlockUpdateChips ();
   return (thisImage);
 }
