File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
main/java/com/google/mu/util/concurrent
test/java/com/google/mu/util/concurrent Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ final class Completion implements AutoCloseable {
2121 private final Phaser phaser = new Phaser (1 );
2222
2323 void run (Runnable task ) {
24- wrap (task ).run ();
24+ toRun (task ).run ();
2525 }
2626
27- Runnable wrap (Runnable task ) {
27+ Runnable toRun (Runnable task ) {
2828 phaser .register ();
2929 return () -> {
3030 try {
Original file line number Diff line number Diff line change @@ -481,17 +481,17 @@ Scope add(Runnable... tasks) {
481481 }
482482
483483 void run () throws StructuredConcurrencyInterruptedException {
484- try (Completion completion = new Completion ()){
485- withUnlimitedConcurrency ().parallelize (runnables .stream ().map (completion ::wrap ));
484+ try (Completion completion = new Completion ()) {
485+ withUnlimitedConcurrency ().parallelize (runnables .stream ().map (completion ::toRun ));
486486 } catch (InterruptedException e ) {
487487 throw new StructuredConcurrencyInterruptedException (e );
488488 }
489489 }
490490
491491 @ Deprecated
492492 void runUninterruptibly () {
493- try (Completion completion = new Completion ()){
494- withUnlimitedConcurrency ().parallelizeUninterruptibly (runnables .stream ().map (completion ::wrap ));
493+ try (Completion completion = new Completion ()) {
494+ withUnlimitedConcurrency ().parallelizeUninterruptibly (runnables .stream ().map (completion ::toRun ));
495495 }
496496 }
497497 }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class CompletionTest {
3636 AtomicBoolean done = new AtomicBoolean ();
3737 try (Completion completion = new Completion ()) {
3838 completion .run (() -> {});
39- new Thread (completion .wrap (() -> {
39+ new Thread (completion .toRun (() -> {
4040 done .set (true );
4141 })).start ();
4242 }
@@ -46,7 +46,7 @@ public class CompletionTest {
4646 @ Test public void twoTasks_failed () throws Exception {
4747 AtomicBoolean done = new AtomicBoolean ();
4848 try (Completion completion = new Completion ()) {
49- new Thread (completion .wrap (() -> {
49+ new Thread (completion .toRun (() -> {
5050 done .set (true );
5151 })).start ();
5252 completion .run (() -> {
You can’t perform that action at this time.
0 commit comments