src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java

Print this page
rev 757 : 8148863: Remove sun.misc.ManagedLocalsThread from corba
Reviewed-by: alanb, coffeys


 442      * WorkQueueImpl.requestWork()
 443      */
 444     void decrementNumberOfAvailableThreads() {
 445         synchronized (workQueue) {
 446             availableWorkerThreads--;
 447         }
 448     }
 449 
 450     /**
 451      * This method will increment the number of available threads
 452      * in the threadpool which are waiting for work. Called from
 453      * WorkQueueImpl.requestWork()
 454      */
 455     void incrementNumberOfAvailableThreads() {
 456         synchronized (workQueue) {
 457             availableWorkerThreads++;
 458         }
 459     }
 460 
 461 
 462     private class WorkerThread extends sun.misc.ManagedLocalsThread implements Closeable
 463     {
 464         private Work currentWork;
 465         private int threadId = 0; // unique id for the thread
 466         private volatile boolean closeCalled = false;
 467         private String threadPoolName;
 468         // name seen by Thread.getName()
 469         private StringBuffer workerThreadName = new StringBuffer();
 470 
 471         WorkerThread(ThreadGroup tg, String threadPoolName) {
 472             super(tg, "Idle");
 473             this.threadId = ThreadPoolImpl.getUniqueThreadId();
 474             this.threadPoolName = threadPoolName;
 475             setName(composeWorkerThreadName(threadPoolName, "Idle"));
 476         }
 477 
 478         public synchronized void close() {
 479             closeCalled = true;
 480             interrupt();
 481         }
 482 
 483         private void resetClassLoader() {
 484 
 485         }
 486 
 487         private void performWork() {
 488             long start = System.currentTimeMillis();
 489             try {
 490                 currentWork.doWork();
 491             } catch (Throwable t) {
 492                 wrapper.workerThreadDoWorkThrowable(this, t);




 442      * WorkQueueImpl.requestWork()
 443      */
 444     void decrementNumberOfAvailableThreads() {
 445         synchronized (workQueue) {
 446             availableWorkerThreads--;
 447         }
 448     }
 449 
 450     /**
 451      * This method will increment the number of available threads
 452      * in the threadpool which are waiting for work. Called from
 453      * WorkQueueImpl.requestWork()
 454      */
 455     void incrementNumberOfAvailableThreads() {
 456         synchronized (workQueue) {
 457             availableWorkerThreads++;
 458         }
 459     }
 460 
 461 
 462     private class WorkerThread extends Thread implements Closeable
 463     {
 464         private Work currentWork;
 465         private int threadId = 0; // unique id for the thread
 466         private volatile boolean closeCalled = false;
 467         private String threadPoolName;
 468         // name seen by Thread.getName()
 469         private StringBuffer workerThreadName = new StringBuffer();
 470 
 471         WorkerThread(ThreadGroup tg, String threadPoolName) {
 472             super(tg, null, "Idle", 0, false);
 473             this.threadId = ThreadPoolImpl.getUniqueThreadId();
 474             this.threadPoolName = threadPoolName;
 475             setName(composeWorkerThreadName(threadPoolName, "Idle"));
 476         }
 477 
 478         public synchronized void close() {
 479             closeCalled = true;
 480             interrupt();
 481         }
 482 
 483         private void resetClassLoader() {
 484 
 485         }
 486 
 487         private void performWork() {
 488             long start = System.currentTimeMillis();
 489             try {
 490                 currentWork.doWork();
 491             } catch (Throwable t) {
 492                 wrapper.workerThreadDoWorkThrowable(this, t);