Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Jobs and ISchedulingRule
Jobs and ISchedulingRule [message #1773561] Fri, 29 September 2017 11:52
Peter Mising name is currently offline Peter Mising nameFriend
Messages: 95
Registered: July 2009
Member
Hello,
I have a problem with a Job ISchedulingRule and after reading the Docs multiple times and debugging around I am still not sure what is wrong.

The purpose is the ISchedulingRule should work like a Mutex. I have a Editor that triggers CodeGen operations as eclipse jobs. These jobs should be worked one after another and trigger subjobs like some JDT stuff which uses the WorkspaceRoot as rule. Hence the contains stuff.

My rule looks like this
public class CodeGenMutex implements ISchedulingRule {
	public boolean isConflicting(ISchedulingRule rule) {
		return contains(rule);
	}

	public boolean contains(ISchedulingRule rule) {
		if (rule instanceof IResource) {
			return true;
		}
		if (rule instanceof MultiRule) {
			for (ISchedulingRule subRule : ((MultiRule) rule).getChildren()) {
				if (!(subRule instanceof IResource)) {
					return rule == this;
				}
			}
			return true;
		}
		return rule == this;
	}
}



So this works as intended but when some jobs are queued very fast after each other the worker will be set to null and the job never finishes.
I assume the ISchedulingRule is not 100% right.
Previous Topic:Mirroring java 9 support plugin for offline usage
Next Topic:unable to create session bean in dynamic web project
Goto Forum:
  


Current Time: Sat Apr 20 01:34:15 GMT 2024

Powered by FUDForum. Page generated in 0.03311 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top