Multithread multihead

This commit is contained in:
Autumn Lamonte 2022-01-29 21:56:17 -06:00
parent 72088134c3
commit de1c946a37

View file

@ -114,10 +114,17 @@ public class MultiBackend implements Backend {
multiScreen.flushPhysical();
int n = backends.size();
for (int i = 0; i < n; i++) {
Backend backend = backends.get(Math.min(i, backends.size()));
final Backend backend = backends.get(Math.min(i, backends.size()));
// Flush to the physical device on another thread.
(new Thread(new Runnable() {
public void run() {
synchronized (backend.getScreen()) {
backend.flushScreen();
}
}
})).start();
}
}
/**
* Check if there are events in the queue.