|
Lines 650-658
Link Here
|
| 650 |
} |
650 |
} |
| 651 |
|
651 |
|
| 652 |
public void run(ITaskListRunnable runnable, IProgressMonitor monitor) throws CoreException { |
652 |
public void run(ITaskListRunnable runnable, IProgressMonitor monitor) throws CoreException { |
|
|
653 |
run(runnable, monitor, false); |
| 654 |
} |
| 655 |
|
| 656 |
public void run(ITaskListRunnable runnable, IProgressMonitor monitor, boolean ignoreInterrupts) |
| 657 |
throws CoreException { |
| 653 |
monitor = Policy.monitorFor(monitor); |
658 |
monitor = Policy.monitorFor(monitor); |
| 654 |
try { |
659 |
try { |
| 655 |
lock(monitor); |
660 |
lock(monitor, ignoreInterrupts); |
| 656 |
|
661 |
|
| 657 |
runnable.execute(monitor); |
662 |
runnable.execute(monitor); |
| 658 |
|
663 |
|
|
Lines 668-674
Link Here
|
| 668 |
} |
673 |
} |
| 669 |
} |
674 |
} |
| 670 |
|
675 |
|
| 671 |
private void lock(IProgressMonitor monitor) throws CoreException { |
676 |
private void lock(IProgressMonitor monitor, boolean ignoreInterrupts) throws CoreException { |
| 672 |
while (!monitor.isCanceled()) { |
677 |
while (!monitor.isCanceled()) { |
| 673 |
try { |
678 |
try { |
| 674 |
if (lock.acquire(3000)) { |
679 |
if (lock.acquire(3000)) { |
|
Lines 678-684
Link Here
|
| 678 |
return; |
683 |
return; |
| 679 |
} |
684 |
} |
| 680 |
} catch (InterruptedException e) { |
685 |
} catch (InterruptedException e) { |
| 681 |
throw new OperationCanceledException(); |
686 |
if (ignoreInterrupts) { |
|
|
687 |
Thread.currentThread().interrupt(); |
| 688 |
} else { |
| 689 |
throw new OperationCanceledException(); |
| 690 |
} |
| 682 |
} |
691 |
} |
| 683 |
} |
692 |
} |
| 684 |
throw new OperationCanceledException(); |
693 |
throw new OperationCanceledException(); |