mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-10-25 13:30:42 +00:00
Reset the watch key after processing events. watckKey -> watchKey
This commit is contained in:
1 parent
7f580a9cc0
commit
5b20f16d44
1 file changed
+6
-2
@@ -91,8 +91,8 @@ public class EvdevLoader implements Runnable {
|
|||||||
evdev.register(watcher, StandardWatchEventKinds.ENTRY_CREATE);
|
evdev.register(watcher, StandardWatchEventKinds.ENTRY_CREATE);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
WatchKey watckKey = watcher.take();
|
WatchKey watchKey = watcher.take();
|
||||||
List<WatchEvent<?>> events = watckKey.pollEvents();
|
List<WatchEvent<?>> events = watchKey.pollEvents();
|
||||||
for (WatchEvent event:events) {
|
for (WatchEvent event:events) {
|
||||||
if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
|
if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
|
||||||
String name = event.context().toString();
|
String name = event.context().toString();
|
||||||
@@ -102,6 +102,10 @@ public class EvdevLoader implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!watchKey.reset()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException | InterruptedException ex) {
|
} catch (IOException | InterruptedException ex) {
|
||||||
LimeLog.severe(ex.getMessage());
|
LimeLog.severe(ex.getMessage());
|
||||||
|
|||||||
Reference in new issue
Block a user