From 7b85a8f6edcd4140da301248c54145bbf9b98781 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Fri, 6 May 2011 18:26:45 +0200 Subject: worker threads should be deamons and should have a name (like all evil things) --- src/com/jogamp/opencl/util/concurrent/CLCommandQueuePool.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/jogamp/opencl/util/concurrent/CLCommandQueuePool.java b/src/com/jogamp/opencl/util/concurrent/CLCommandQueuePool.java index 205f0393..92828e95 100644 --- a/src/com/jogamp/opencl/util/concurrent/CLCommandQueuePool.java +++ b/src/com/jogamp/opencl/util/concurrent/CLCommandQueuePool.java @@ -129,16 +129,18 @@ public class CLCommandQueuePool implements CLResource { } public synchronized Thread newThread(Runnable r) { - CLCommandQueue queue = queues.get(index++); - return new QueueThread(queue); + CLCommandQueue queue = queues.get(index); + return new QueueThread(queue, index++); } } private static class QueueThread extends Thread { private final CLCommandQueue queue; - public QueueThread(CLCommandQueue queue) { + public QueueThread(CLCommandQueue queue, int index) { + super("queue-worker-thread-"+index+"["+queue+"]"); this.queue = queue; + this.setDaemon(true); } } -- cgit v1.2.3