equal
deleted
inserted
replaced
51 } |
51 } |
52 |
52 |
53 public void run() { |
53 public void run() { |
54 // wait when interrupted thread switches state to 'TIMED_WAITING' |
54 // wait when interrupted thread switches state to 'TIMED_WAITING' |
55 while ((threadToInterrupt.getState() != Thread.State.WAITING) && !exitedFromWait) { |
55 while ((threadToInterrupt.getState() != Thread.State.WAITING) && !exitedFromWait) { |
56 yield(); |
56 Thread.yield(); |
57 } |
57 } |
58 |
58 |
59 // threadToInterrupt 'spuriously' exited from wait() |
59 // threadToInterrupt 'spuriously' exited from wait() |
60 if(exitedFromWait) |
60 if(exitedFromWait) |
61 return; |
61 return; |
234 } |
234 } |
235 |
235 |
236 public void run() { |
236 public void run() { |
237 // wait when blocked thread switches state to 'BLOCKED' |
237 // wait when blocked thread switches state to 'BLOCKED' |
238 while (blockedThread.getState() != Thread.State.BLOCKED) |
238 while (blockedThread.getState() != Thread.State.BLOCKED) |
239 yield(); |
239 Thread.yield(); |
240 |
240 |
241 lockingThread.releaseLock(); |
241 lockingThread.releaseLock(); |
242 } |
242 } |
243 } |
243 } |
244 |
244 |