Index: trunk/Ohana/src/opihi/pantasks/task.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/task.c	(revision 14590)
+++ trunk/Ohana/src/opihi/pantasks/task.c	(revision 23530)
@@ -11,4 +11,5 @@
   if (argc != 2) goto usage;
 
+  JobTaskLock();
   task = FindTask (argv[1]);
   if (task == NULL) { /**** new task ****/
@@ -18,4 +19,6 @@
     SetNewTask (task);
   }
+  JobTaskUnlock();
+
   /* While a task is being defined, it is removed from the task list.  The new task is added to the task list
      when the definition process is complete.  
@@ -55,6 +58,4 @@
 
       case TASK_END:
-	/* I need to add in a test here to see if all task elements 
-	   have been defined.  delete the task if not */
 	free (input);
 	/* validate the new task: all mandatory elements defined? */ 
@@ -63,5 +64,7 @@
 	  return (FALSE);
 	}
+	JobTaskLock();
 	RegisterNewTask ();
+	JobTaskUnlock();
 	return (TRUE);
 	break;
