mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-21 20:21:27 +00:00
code simplification [ci skip]
This commit is contained in:
@@ -89,17 +89,14 @@ public class ConcurrencyTests {
|
||||
|
||||
private final SynchronousQueue<Runnable> handoverQueue = new SynchronousQueue<>();
|
||||
private final Thread thread = new Thread(() -> {
|
||||
Runnable task;
|
||||
while (true) {
|
||||
try {
|
||||
task = handoverQueue.take();
|
||||
} catch (InterruptedException e) {
|
||||
return;
|
||||
try {
|
||||
Runnable task;
|
||||
while ((task = handoverQueue.take()) != TERMINATION_HINT) {
|
||||
task.run();
|
||||
}
|
||||
if (task == TERMINATION_HINT) {
|
||||
break;
|
||||
}
|
||||
task.run();
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user