diff options
author | Michael Bien <[email protected]> | 2011-05-06 18:26:45 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2011-05-06 18:26:45 +0200 |
commit | 7b85a8f6edcd4140da301248c54145bbf9b98781 (patch) | |
tree | b4d8716d75253d1bb57c0e625af3c457b8927761 /src/com/jogamp/opencl/util/concurrent | |
parent | ba3c4f8e28235c1e0780a88d7cd087abfaddc61b (diff) |
worker threads should be deamons and should have a name (like all evil things)
Diffstat (limited to 'src/com/jogamp/opencl/util/concurrent')
-rw-r--r-- | src/com/jogamp/opencl/util/concurrent/CLCommandQueuePool.java | 8 |
1 files changed, 5 insertions, 3 deletions
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); } } |