/** * Get the thread whose locks can be suspended. (i.e. all locks it owns are * actual locks and not rules). Return the first thread in the array by default. */ private Thread resolutionCandidate(Thread[] candidates) { //first look for a candidate that has no scheduling rules for (int i = 0; i < candidates.length; i++) { if (!ownsRuleLocks(candidates[i])) return candidates[i]; } //next look for any candidate with a real lock (a lock that can be suspended) for (int i = 0; i < candidates.length; i++) { if (ownsRealLocks(candidates[i])) return candidates[i]; } //unnecessary, return the first entry in the array by default return candidates[0]; }
/** * Get the thread whose locks can be suspended. (i.e. all locks it owns are * actual locks and not rules). Return the first thread in the array by default. */ private Thread resolutionCandidate(Thread[] candidates) { //first look for a candidate that has no scheduling rules for (int i = 0; i < candidates.length; i++) { if (!ownsRuleLocks(candidates[i])) return candidates[i]; } //next look for any candidate with a real lock (a lock that can be suspended) for (int i = 0; i < candidates.length; i++) { if (ownsRealLocks(candidates[i])) return candidates[i]; } //unnecessary, return the first entry in the array by default return candidates[0]; }
/** * Get the thread whose locks can be suspended. (i.e. all locks it owns are * actual locks and not rules). Return the first thread in the array by default. */ private Thread resolutionCandidate(Thread[] candidates) { //first look for a candidate that has no scheduling rules for (int i = 0; i < candidates.length; i++) { if (!ownsRuleLocks(candidates[i])) return candidates[i]; } //next look for any candidate with a real lock (a lock that can be suspended) for (int i = 0; i < candidates.length; i++) { if (ownsRealLocks(candidates[i])) return candidates[i]; } //unnecessary, return the first entry in the array by default return candidates[0]; }
/** * Get the thread whose locks can be suspended. (i.e. all locks it owns are * actual locks and not rules). Return the first thread in the array by default. */ private Thread resolutionCandidate(Thread[] candidates) { //first look for a candidate that has no scheduling rules for (int i = 0; i < candidates.length; i++) { if (!ownsRuleLocks(candidates[i])) return candidates[i]; } //next look for any candidate with a real lock (a lock that can be suspended) for (int i = 0; i < candidates.length; i++) { if (ownsRealLocks(candidates[i])) return candidates[i]; } //unnecessary, return the first entry in the array by default return candidates[0]; }