/** * Sleep for the given duration or until woken. */ private synchronized void sleep(long duration) { sleepingThreads++; busyThreads--; if (JobManager.DEBUG) JobManager.debug("worker sleeping for: " + duration + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ try { wait(duration); } catch (InterruptedException e) { if (JobManager.DEBUG) JobManager.debug("worker interrupted while waiting... :-|"); //$NON-NLS-1$ } finally { sleepingThreads--; busyThreads++; } }
/** * Sleep for the given duration or until woken. */ private synchronized void sleep(long duration) { sleepingThreads++; busyThreads--; if (JobManager.DEBUG) JobManager.debug("worker sleeping for: " + duration + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ try { wait(duration); } catch (InterruptedException e) { if (JobManager.DEBUG) JobManager.debug("worker interrupted while waiting... :-|"); //$NON-NLS-1$ } finally { sleepingThreads--; busyThreads++; } }
/** * Sleep for the given duration or until woken. */ private synchronized void sleep(long duration) { sleepingThreads++; busyThreads--; if (JobManager.DEBUG) JobManager.debug("worker sleeping for: " + duration + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ try { wait(duration); } catch (InterruptedException e) { if (JobManager.DEBUG) JobManager.debug("worker interrupted while waiting... :-|"); //$NON-NLS-1$ } finally { sleepingThreads--; busyThreads++; } }
/** * Sleep for the given duration or until woken. */ private synchronized void sleep(long duration) { sleepingThreads++; busyThreads--; if (JobManager.DEBUG) JobManager.debug("worker sleeping for: " + duration + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ try { wait(duration); } catch (InterruptedException e) { if (JobManager.DEBUG) JobManager.debug("worker interrupted while waiting... :-|"); //$NON-NLS-1$ } finally { sleepingThreads--; busyThreads++; } }
/** * Implements IJobManager#resume(ISchedulingRule) * @param rule */ void resume(ISchedulingRule rule) { //resume happens as a consequence of freeing the last rule in the stack end(rule, true); if (JobManager.DEBUG_BEGIN_END) JobManager.debug("Resume rule: " + rule); //$NON-NLS-1$ }
/** * Implements IJobManager#resume(ISchedulingRule) * @param rule */ void resume(ISchedulingRule rule) { //resume happens as a consequence of freeing the last rule in the stack end(rule, true); if (JobManager.DEBUG_BEGIN_END) JobManager.debug("Resume rule: " + rule); //$NON-NLS-1$ }
/** * Implements IJobManager#suspend(ISchedulingRule, IProgressMonitor) * @param rule * @param monitor */ void suspend(ISchedulingRule rule, IProgressMonitor monitor) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug("Suspend rule: " + rule); //$NON-NLS-1$ //the suspend job will be remembered once the rule is acquired begin(rule, monitor, true); }
/** * Signals the death of a worker thread. Note that this method can be called under * OutOfMemoryError conditions and thus must be paranoid about allocating objects. */ protected synchronized void endWorker(Worker worker) { if (remove(worker) && JobManager.DEBUG) JobManager.debug("worker removed from pool: " + worker); //$NON-NLS-1$ }
/** * Signals the death of a worker thread. Note that this method can be called under * OutOfMemoryError conditions and thus must be paranoid about allocating objects. */ protected synchronized void endWorker(Worker worker) { if (remove(worker) && JobManager.DEBUG) JobManager.debug("worker removed from pool: " + worker); //$NON-NLS-1$ }
/** * Signals the death of a worker thread. Note that this method can be called under * OutOfMemoryError conditions and thus must be paranoid about allocating objects. */ protected synchronized void endWorker(Worker worker) { if (remove(worker) && JobManager.DEBUG) JobManager.debug("worker removed from pool: " + worker); //$NON-NLS-1$ }
/** * Implements IJobManager#resume(ISchedulingRule) * @param rule */ void resume(ISchedulingRule rule) { //resume happens as a consequence of freeing the last rule in the stack end(rule, true); if (JobManager.DEBUG_BEGIN_END) JobManager.debug("Resume rule: " + rule); //$NON-NLS-1$ }
/** * Implements IJobManager#suspend(ISchedulingRule, IProgressMonitor) * @param rule * @param monitor */ void suspend(ISchedulingRule rule, IProgressMonitor monitor) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug("Suspend rule: " + rule); //$NON-NLS-1$ //the suspend job will be remembered once the rule is acquired begin(rule, monitor, true); }
/** * Signals the death of a worker thread. Note that this method can be called under * OutOfMemoryError conditions and thus must be paranoid about allocating objects. */ protected synchronized void endWorker(Worker worker) { if (remove(worker) && JobManager.DEBUG) JobManager.debug("worker removed from pool: " + worker); //$NON-NLS-1$ }
/** * Implements IJobManager#suspend(ISchedulingRule, IProgressMonitor) * @param rule * @param monitor */ void suspend(ISchedulingRule rule, IProgressMonitor monitor) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug("Suspend rule: " + rule); //$NON-NLS-1$ //the suspend job will be remembered once the rule is acquired begin(rule, monitor, true); }
/** * Implements IJobManager#suspend(ISchedulingRule, IProgressMonitor) * @param rule * @param monitor */ void suspend(ISchedulingRule rule, IProgressMonitor monitor) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug("Suspend rule: " + rule); //$NON-NLS-1$ //the suspend job will be remembered once the rule is acquired begin(rule, monitor, true); }
/** * Implements IJobManager#resume(ISchedulingRule) * @param rule */ void resume(ISchedulingRule rule) { //resume happens as a consequence of freeing the last rule in the stack end(rule, true); if (JobManager.DEBUG_BEGIN_END) JobManager.debug("Resume rule: " + rule); //$NON-NLS-1$ }
synchronized void end(ISchedulingRule rule, boolean resume) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug("End rule: " + rule); //$NON-NLS-1$ ThreadJob threadJob = (ThreadJob) threadJobs.get(Thread.currentThread()); if (threadJob == null) Assert.isLegal(rule == null, "endRule without matching beginRule: " + rule); //$NON-NLS-1$ else if (threadJob.pop(rule)) { endThreadJob(threadJob, resume); } }
synchronized void end(ISchedulingRule rule, boolean resume) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug("End rule: " + rule); //$NON-NLS-1$ ThreadJob threadJob = threadJobs.get(Thread.currentThread()); if (threadJob == null) Assert.isLegal(rule == null, "endRule without matching beginRule: " + rule); //$NON-NLS-1$ else if (threadJob.pop(rule)) { endThreadJob(threadJob, resume); } }
synchronized void end(ISchedulingRule rule, boolean resume) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug("End rule: " + rule); //$NON-NLS-1$ ThreadJob threadJob = (ThreadJob) threadJobs.get(Thread.currentThread()); if (threadJob == null) Assert.isLegal(rule == null, "endRule without matching beginRule: " + rule); //$NON-NLS-1$ else if (threadJob.pop(rule)) { endThreadJob(threadJob, resume); } }
synchronized void end(ISchedulingRule rule, boolean resume) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug("End rule: " + rule); //$NON-NLS-1$ ThreadJob threadJob = threadJobs.get(Thread.currentThread()); if (threadJob == null) Assert.isLegal(rule == null, "endRule without matching beginRule: " + rule); //$NON-NLS-1$ else if (threadJob.pop(rule)) { endThreadJob(threadJob, resume); } }