synchronized void addWaiting(ThreadJob threadJob) { synchronized (((InternalJob) threadJob).jobStateLock) { threadJob.isWaiting = true; notifyWaitingThreadJobs(threadJob); ((InternalJob) threadJob).setWaitQueueStamp(manager.waitQueueCounter.increment()); } manager.enqueue(manager.waitingThreadJobs, threadJob); }
/** * This method is called when the plug-in is stopped */ @Override public void stop(BundleContext context) throws Exception { unregisterServices(); JobManager.shutdown(); JobOSGiUtils.getDefault().closeServices(); bundleContext = null; }
synchronized void removeWaiting(ThreadJob threadJob) { synchronized (((InternalJob) threadJob).jobStateLock) { threadJob.isWaiting = false; notifyWaitingThreadJobs(threadJob); ((InternalJob) threadJob).setWaitQueueStamp(InternalJob.T_NONE); } manager.dequeue(manager.waitingThreadJobs, threadJob); }
/** * Releases this lock from the thread that used to own it. * Grants this lock to the next thread in the queue. */ private synchronized void doRelease() { //notify hook manager.aboutToRelease(); depth = 0; Semaphore next = (Semaphore) operations.peek(); setCurrentOperationThread(null); if (next != null) next.release(); }
private JobManager() { instance = this; initDebugOptions(); synchronized (lock) { waiting = new JobQueue(false); sleeping = new JobQueue(true); running = new HashSet(10); pool = new WorkerPool(this); } pool.setDaemon(JobOSGiUtils.getDefault().useDaemonThreads()); }
ThreadJob(ISchedulingRule rule) { super("Implicit Job"); //$NON-NLS-1$ setSystem(true); // calling setPriority will try to acquire JobManager.lock, breaking // lock acquisition protocol. Since we are constructing this thread, // we can call internalSetPriority ((InternalJob) this).internalSetPriority(Job.INTERACTIVE); ruleStack = new ISchedulingRule[2]; top = -1; ((InternalJob) this).internalSetRule(rule); }
/** * 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$ }
/** * For debugging purposes only */ public static String printState(Job job) { return printState(((InternalJob) job).internalGetState()); }
/** * This method is called when the plug-in is stopped */ public void stop(BundleContext context) throws Exception { unregisterServices(); JobManager.shutdown(); JobOSGiUtils.getDefault().closeServices(); bundleContext = null; }
/** * Releases this lock from the thread that used to own it. * Grants this lock to the next thread in the queue. */ private synchronized void doRelease() { //notify hook manager.aboutToRelease(); depth = 0; Semaphore next = (Semaphore) operations.peek(); setCurrentOperationThread(null); if (next != null) next.release(); }
synchronized void addWaiting(ThreadJob threadJob) { synchronized (((InternalJob) threadJob).jobStateLock) { threadJob.isWaiting = true; notifyWaitingThreadJobs(threadJob); ((InternalJob) threadJob).setWaitQueueStamp(manager.waitQueueCounter.increment()); } manager.enqueue(manager.waitingThreadJobs, threadJob); }
synchronized void removeWaiting(ThreadJob threadJob) { synchronized (((InternalJob) threadJob).jobStateLock) { threadJob.isWaiting = false; notifyWaitingThreadJobs(threadJob); ((InternalJob) threadJob).setWaitQueueStamp(InternalJob.T_NONE); } manager.dequeue(manager.waitingThreadJobs, threadJob); }
/** * This method is called when the plug-in is stopped */ @Override public void stop(BundleContext context) throws Exception { unregisterServices(); JobManager.shutdown(); JobOSGiUtils.getDefault().closeServices(); bundleContext = null; }
/** * Releases this lock from the thread that used to own it. * Grants this lock to the next thread in the queue. */ private synchronized void doRelease() { //notify hook manager.aboutToRelease(); depth = 0; Semaphore next = (Semaphore) operations.peek(); setCurrentOperationThread(null); if (next != null) next.release(); }
synchronized void addWaiting(ThreadJob threadJob) { synchronized (((InternalJob) threadJob).jobStateLock) { threadJob.isWaiting = true; notifyWaitingThreadJobs(threadJob); ((InternalJob) threadJob).setWaitQueueStamp(manager.waitQueueCounter.increment()); } manager.enqueue(manager.waitingThreadJobs, threadJob); }
synchronized void removeWaiting(ThreadJob threadJob) { synchronized (((InternalJob) threadJob).jobStateLock) { threadJob.isWaiting = false; notifyWaitingThreadJobs(threadJob); ((InternalJob) threadJob).setWaitQueueStamp(InternalJob.T_NONE); } manager.dequeue(manager.waitingThreadJobs, threadJob); }
/** * This method is called when the plug-in is stopped */ public void stop(BundleContext context) throws Exception { unregisterServices(); JobManager.shutdown(); JobOSGiUtils.getDefault().closeServices(); bundleContext = null; }
/** * Releases this lock from the thread that used to own it. * Grants this lock to the next thread in the queue. */ private synchronized void doRelease() { //notify hook manager.aboutToRelease(); depth = 0; Semaphore next = (Semaphore) operations.peek(); setCurrentOperationThread(null); if (next != null) next.release(); }