private void endThreadJob(ThreadJob threadJob, boolean resume) { Thread currentThread = Thread.currentThread(); //clean up when last rule scope exits threadJobs.remove(currentThread); ISchedulingRule rule = threadJob.getRule(); if (resume && rule != null) suspendedRules.remove(rule); //if this job had a rule, then we are essentially releasing a lock //note it is safe to do this even if the acquire was aborted if (threadJob.acquireRule) { manager.getLockManager().removeLockThread(currentThread, rule); notifyWaitingThreadJobs(); } //if the job was started, we need to notify job manager to end it if (threadJob.isRunning()) manager.endJob(threadJob, Status.OK_STATUS, false); recycle(threadJob); }
/** * @GuardedBy("this") */ private void endThreadJob(ThreadJob threadJob, boolean resume) { Thread currentThread = Thread.currentThread(); //clean up when last rule scope exits threadJobs.remove(currentThread); ISchedulingRule rule = threadJob.getRule(); if (resume && rule != null) suspendedRules.remove(rule); //if this job had a rule, then we are essentially releasing a lock //note it is safe to do this even if the acquire was aborted if (threadJob.acquireRule) { manager.getLockManager().removeLockThread(currentThread, rule); notifyWaitingThreadJobs(threadJob); } //if the job was started, we need to notify job manager to end it if (threadJob.isRunning()) manager.endJob(threadJob, Status.OK_STATUS, false); recycle(threadJob); }
/** * @GuardedBy("this") */ private void endThreadJob(ThreadJob threadJob, boolean resume) { Thread currentThread = Thread.currentThread(); //clean up when last rule scope exits threadJobs.remove(currentThread); ISchedulingRule rule = threadJob.getRule(); if (resume && rule != null) suspendedRules.remove(rule); //if this job had a rule, then we are essentially releasing a lock //note it is safe to do this even if the acquire was aborted if (threadJob.acquireRule) { manager.getLockManager().removeLockThread(currentThread, rule); notifyWaitingThreadJobs(threadJob); } //if the job was started, we need to notify job manager to end it if (threadJob.isRunning()) manager.endJob(threadJob, Status.OK_STATUS, false); recycle(threadJob); }
/** * @GuardedBy("this") */ private void endThreadJob(ThreadJob threadJob, boolean resume) { Thread currentThread = Thread.currentThread(); //clean up when last rule scope exits threadJobs.remove(currentThread); ISchedulingRule rule = threadJob.getRule(); if (resume && rule != null) suspendedRules.remove(rule); //if this job had a rule, then we are essentially releasing a lock //note it is safe to do this even if the acquire was aborted if (threadJob.acquireRule) { manager.getLockManager().removeLockThread(currentThread, rule); notifyWaitingThreadJobs(threadJob); } //if the job was started, we need to notify job manager to end it if (threadJob.isRunning()) manager.endJob(threadJob, Status.OK_STATUS, false); recycle(threadJob); }