com.sun.corba.se.impl.orbutil.threadpool.WorkQueueImpl Java Examples

The following examples show how to use com.sun.corba.se.impl.orbutil.threadpool.WorkQueueImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ThreadPoolImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #2
Source File: ThreadPoolImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #3
Source File: ThreadPoolImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #4
Source File: ThreadPoolImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #5
Source File: ThreadPoolImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #6
Source File: ThreadPoolImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #7
Source File: ThreadPoolImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #8
Source File: ThreadPoolImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #9
Source File: ThreadPoolImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #10
Source File: ThreadPoolImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #11
Source File: ThreadPoolImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #12
Source File: ThreadPoolImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #13
Source File: ThreadPoolImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #14
Source File: ThreadPoolImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #15
Source File: ThreadPoolImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #16
Source File: ThreadPoolImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #17
Source File: ThreadPoolImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #18
Source File: ThreadPoolImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #19
Source File: ThreadPoolImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #20
Source File: ThreadPoolImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #21
Source File: ThreadPoolImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #22
Source File: ThreadPoolImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #23
Source File: ThreadPoolImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #24
Source File: ThreadPoolImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #25
Source File: ThreadPoolImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #26
Source File: ThreadPoolImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #27
Source File: ThreadPoolImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}
 
Example #28
Source File: ThreadPoolImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * This constructor is used to create bounded threadpool
 */
public ThreadPoolImpl(int minSize, int maxSize, long timeout,
                                        String threadpoolName)
{
    minWorkerThreads = minSize;
    maxWorkerThreads = maxSize;
    inactivityTimeout = timeout;
    boundedThreadPool = true;
    workQueue = new WorkQueueImpl(this);
    name = threadpoolName;
    for (int i = 0; i < minWorkerThreads; i++) {
        createWorkerThread();
    }
    initializeMonitoring();
}
 
Example #29
Source File: ThreadPoolImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void run() {
    try  {
        while (!closeCalled) {
            try {
                currentWork = ((WorkQueueImpl)workQueue).requestWork(
                    inactivityTimeout);
                if (currentWork == null)
                    continue;
            } catch (InterruptedException exc) {
                wrapper.workQueueThreadInterrupted( exc, getName(),
                   Boolean.valueOf(closeCalled));

                continue ;
            } catch (Throwable t) {
                 wrapper.workerThreadThrowableFromRequestWork(this, t,
                        workQueue.getName());

                continue;
            }

            performWork();

            // set currentWork to null so that the work item can be
            // garbage collected without waiting for the next work item.
            currentWork = null;

            resetClassLoader();
        }
    } catch (Throwable e) {
        // This should not be possible
        wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
    } finally {
        synchronized (workersLock) {
            workers.remove(this);
        }
    }
}
 
Example #30
Source File: ThreadPoolImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor is used to create an unbounded threadpool
 */
public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) {
    inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
    maxWorkerThreads = Integer.MAX_VALUE;
    workQueue = new WorkQueueImpl(this);
    threadGroup = tg;
    name = threadpoolName;
    initializeMonitoring();
}