1 30 31 32 package org.hsqldb.lib; 33 34 44 class HsqlThreadFactory implements ThreadFactory { 45 46 50 protected ThreadFactory factory; 51 52 56 public HsqlThreadFactory() { 57 this(null); 58 } 59 60 67 public HsqlThreadFactory(ThreadFactory f) { 68 setImpl(f); 69 } 70 71 76 public Thread newThread(Runnable r) { 77 return factory == this ? new Thread (r) 78 : factory.newThread(r); 79 } 80 81 90 public synchronized ThreadFactory setImpl(ThreadFactory f) { 91 92 ThreadFactory old; 93 94 old = factory; 95 factory = (f == null) ? this 96 : f; 97 98 return old; 99 } 100 101 108 public synchronized ThreadFactory getImpl() { 109 return factory; 110 } 111 } 112 | Popular Tags |