Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 283446
Collapse All | Expand All

(-)src/org/eclipse/core/internal/jobs/JobManager.java (+11 lines)
Lines 483-488 Link Here
483
		return null;
483
		return null;
484
	}
484
	}
485
485
486
	public ISchedulingRule currentRule() {
487
		//check thread job first, because actual current job may have null rule
488
		Job currentJob = implicitJobs.getThreadJob(Thread.currentThread());
489
		if (currentJob != null)
490
			return currentJob.getRule();
491
		currentJob = currentJob();
492
		if (currentJob != null)
493
			return currentJob.getRule();
494
		return null;
495
	}
496
486
	/**
497
	/**
487
	 * Returns the delay in milliseconds that a job with a given priority can
498
	 * Returns the delay in milliseconds that a job with a given priority can
488
	 * tolerate waiting.
499
	 * tolerate waiting.
(-)src/org/eclipse/core/runtime/jobs/IJobManager.java (-1 / +17 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2009 IBM Corporation and others.
2
 * Copyright (c) 2003, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 142-147 Link Here
142
	public IProgressMonitor createProgressGroup();
142
	public IProgressMonitor createProgressGroup();
143
143
144
	/**
144
	/**
145
	 * Returns the scheduling rule currently held by this thread, or <code>null</code>
146
	 * if the current thread does not hold any scheduling rule.
147
	 * <p>
148
	 * If this method is called from within the scope of a running job with a non-null
149
	 * scheduling rule, then this method is equivalent to calling <code>currentJob().getRule()</code>.
150
	 * Otherwise, this method will return the first scheduling rule obtained by this 
151
	 * thread via {@link #beginRule(ISchedulingRule, IProgressMonitor)} that has not
152
	 * yet had a corresponding call to {@link #endRule(ISchedulingRule)}.
153
	 * </p>
154
	 * 
155
	 * @return the current rule or <code>null</code>
156
	 * @since 3.5
157
	 */
158
	public ISchedulingRule currentRule();
159
160
	/**
145
	 * Returns the job that is currently running in this thread, or <code>null</code> if there
161
	 * Returns the job that is currently running in this thread, or <code>null</code> if there
146
	 * is no currently running job.
162
	 * is no currently running job.
147
	 * 
163
	 * 

Return to bug 283446