Replies: 1 comment
-
You can try something like try {
jobManager.beginRule(rule, monitor);
return true;
} catch (IllegalArgumentException ex) {
return false;
} finally {
manager.endRule(rule);
} Or, with the currentRule, you can know if your operation can be scheduled or not in that thread calling by getting the currentRule and calling |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Assume i have the following
ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
now I want to check if the current thread "owns" the rule already, similar to
https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#holdsLock%28java.lang.Object%29
I poked around a bit but didn't finde something in this regards, there is
Job.getJobManager().currentRule()
but from the description it will give different results depending on if its called from a Job and also depends on nesting rules...Beta Was this translation helpful? Give feedback.
All reactions