mirror of
https://gitlab.com/AutumnMeowMeow/jexer
synced 2024-09-19 03:40:20 -06:00
Multithread multihead
This commit is contained in:
parent
72088134c3
commit
de1c946a37
1 changed files with 9 additions and 2 deletions
|
@ -114,8 +114,15 @@ 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()));
|
||||
backend.flushScreen();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue