diff --git a/lib/coderunner/class_methods.rb b/lib/coderunner/class_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/coderunner/class_methods.rb
+++ b/lib/coderunner/class_methods.rb
@@ -390,13 +390,27 @@ EOF
     FileUtils.makedirs tl
 
     unless ENV['CODE_RUNNER_LAUNCHER'] =~ /serial/
-      Thread.new{loop{`cp #{tl}/queue_status.txt #{tl}/queue_status2.txt; ps > #{tl}/queue_status.txt`; sleep 1}}
-
       mutex = Mutex.new
       processes= []
 
       Thread.new do
         loop do
+          `cp #{tl}/queue_status.txt #{tl}/queue_status2.txt`
+          `ps > #{tl}/queue_status.txt`
+          mutex.synchronize do 
+            File.open("#{tl}/queue_status.txt", 'a') do |f| 
+              # This ensures that the right pids will be listed,
+              # regardless of the way that ps behaves
+              f.puts processes 
+            end
+          end
+          sleep 1
+        end
+      end
+
+
+      Thread.new do
+        loop do
           Dir.entries(tl).each do |file|
             next unless file =~ (/(^.*)\.stop/)
             pid = $1
--Small patch to ensure that the correct pids always show up in the queue_status for launcher