Because of cross references in static fields of some fj classes (e.g. Equal and LazyString) we can encounter a deadlock if we use it in parallel.
Consider the following code:
public void test() throws InterruptedException {
Thread thread1 = new Thread(() -> {
sleep();
Equal.anyEqual();
});
Thread thread2 = new Thread(() -> {
sleep();
LazyString.lines_();
});
thread1.start();
thread2.start();
thread1.join();
thread2.join();
}
private void sleep() {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
Most of the times it just never ends.
Because of cross references in static fields of some fj classes (e.g. Equal and LazyString) we can encounter a deadlock if we use it in parallel.
Consider the following code:
Most of the times it just never ends.