public static double hypotenuse(double a, double b) {
Lock lock = new ReentrantLock();
double[] sum = {0.0};
Future<Void> future = void_fork(() -> {
lock.lock();
try {
sum[0] += a * a;
} finally {
lock.unlock();
}
});
sum[0] += b * b;
join(future);
return Math.sqrt(sum[0]);
}
public static double hypotenuse(double a, double b)