Index: trunk/psLib/src/sys/psThread.c
===================================================================
--- trunk/psLib/src/sys/psThread.c	(revision 32409)
+++ trunk/psLib/src/sys/psThread.c	(revision 32481)
@@ -36,6 +36,6 @@
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; // Mutex for locking threads
 
-static psList *pending = NULL;          // queue of pending jobs
-static psList *done = NULL;             // queue of done jobs
+static volatile psList *pending = NULL; // queue of pending jobs
+static volatile psList *done = NULL;    // queue of done jobs
 static pthread_t *threads = NULL;       // array of the POSIX thread handles
 static psArray *pool = NULL;            // array of defined threads
@@ -116,5 +116,5 @@
             done = psListAlloc(NULL);
         }
-        psListAdd(done, PS_LIST_TAIL, job);
+        psListAdd((psList *)done, PS_LIST_TAIL, job);
         psFree(job);
         return task->function(job);
@@ -125,5 +125,5 @@
         pending = psListAlloc(NULL);
     }
-    psListAdd(pending, PS_LIST_TAIL, job);
+    psListAdd((psList *)pending, PS_LIST_TAIL, job);
     psFree(job);
     psThreadUnlock();
@@ -139,5 +139,5 @@
     }
 
-    psThreadJob *job = psListGetAndRemove(pending, PS_LIST_HEAD);
+    psThreadJob *job = psListGetAndRemove((psList *)pending, PS_LIST_HEAD);
     return job;
 }
@@ -150,5 +150,5 @@
     }
 
-    psThreadJob *job = psListGetAndRemove(done, PS_LIST_HEAD);
+    psThreadJob *job = psListGetAndRemove((psList *) done, PS_LIST_HEAD);
     return job;
 }
@@ -253,5 +253,5 @@
             done = psListAlloc(NULL);
         }
-        psListAdd(done, PS_LIST_TAIL, job);
+        psListAdd((psList *)done, PS_LIST_TAIL, job);
         psFree(job);
 
