Index: /branches/eam_branch_20080719/psLib/src/sys/psThread.c
===================================================================
--- /branches/eam_branch_20080719/psLib/src/sys/psThread.c	(revision 18750)
+++ /branches/eam_branch_20080719/psLib/src/sys/psThread.c	(revision 18751)
@@ -17,5 +17,7 @@
 
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-static psList *queue = NULL;		// queue of pending jobs
+static psList *pending = NULL;		// queue of pending jobs
+static psList *done = NULL;		// queue of done jobs
+
 static psArray *pool = NULL;		// array of defined threads
 
@@ -50,13 +52,13 @@
 }
 
-// add a job to the queue of active jobs
-bool psThreadJobAddToQueue (psThreadJob *job) {
+// add a job to the queue of pending jobs
+bool psThreadJobAddPending (psThreadJob *job) {
 
     psThreadLock ();
-    if (queue == NULL) {
-	queue = psListAlloc(NULL);
+    if (pending == NULL) {
+	pending = psListAlloc(NULL);
     }
 
-    psListAdd (queue, PS_LIST_TAIL, job);
+    psListAdd (pending, PS_LIST_TAIL, job);
     psThreadUnlock ();
     return true;
@@ -64,7 +66,26 @@
 
 // this function is not locked -- see thread launder for example
-psThreadJob *psThreadJobGet () {
+psThreadJob *psThreadJobGetPending () {
 
-    psThreadJob *job = psListGetAndRemove (queue, PS_LIST_HEAD);
+    if (!pending) return NULL;
+
+    psThreadJob *job = psListGetAndRemove (pending, PS_LIST_HEAD);
+
+    // jobs we pull off the pending queue get placed on the done queue
+    if (job) {
+	if (done == NULL) {
+	    done = psListAlloc(NULL);
+	}
+	psListAdd (done, PS_LIST_TAIL, job);
+    }
+    return job;
+}
+
+// this function is not locked -- see thread launder for example
+psThreadJob *psThreadJobGetDone () {
+
+    if (!done) return NULL;
+
+    psThreadJob *job = psListGetAndRemove (done, PS_LIST_HEAD);
     return job;
 }
@@ -122,5 +143,5 @@
 
 	// is the queue empty?
-	if (queue->head == NULL) {
+	if (pending->head == NULL) {
 	    psThreadUnlock();
 	    return true;
Index: /branches/eam_branch_20080719/psLib/src/sys/psThread.h
===================================================================
--- /branches/eam_branch_20080719/psLib/src/sys/psThread.h	(revision 18750)
+++ /branches/eam_branch_20080719/psLib/src/sys/psThread.h	(revision 18751)
@@ -4,6 +4,6 @@
  *
  *  @author EAM, IFA
- *  @version $Revision: 1.1.2.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-07-26 03:48:39 $
+ *  @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-07-27 17:59:42 $
  *
  *  Copyright 2004-2005 Insitute for Astronomy, University of Hawaii
@@ -33,6 +33,7 @@
 
 psThreadJob *psThreadJobAlloc (char *type, int nArgs);
-bool psThreadJobAddToQueue (psThreadJob *job);
-psThreadJob *psThreadJobGet ();
+bool psThreadJobAddPending (psThreadJob *job);
+psThreadJob *psThreadJobGetPending ();
+psThreadJob *psThreadJobGetDone ();
 
 psThread *psThreadAlloc ();
