mirror of
https://github.com/Maschell/HIDtoVPADNetworkClient.git
synced 2024-11-22 14:09:17 +01:00
Fixed possible problem with the LinuxDevInputController
This commit is contained in:
parent
82a25e0cf4
commit
3918a71627
@ -62,7 +62,7 @@ public abstract class Controller implements Runnable{
|
|||||||
if(newData != null){
|
if(newData != null){
|
||||||
setLatestData(newData);
|
setLatestData(newData);
|
||||||
}
|
}
|
||||||
Utilities.sleep(10);
|
doSleepAfterPollingData();
|
||||||
}
|
}
|
||||||
synchronized (shutdownLock) {
|
synchronized (shutdownLock) {
|
||||||
shutdownState = shutdown;
|
shutdownState = shutdown;
|
||||||
@ -73,6 +73,10 @@ public abstract class Controller implements Runnable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void doSleepAfterPollingData() {
|
||||||
|
Utilities.sleep(10);
|
||||||
|
}
|
||||||
|
|
||||||
@Synchronized("dataLock")
|
@Synchronized("dataLock")
|
||||||
private void setLatestData(byte[] newData) {
|
private void setLatestData(byte[] newData) {
|
||||||
this.latestData = newData;
|
this.latestData = newData;
|
||||||
|
@ -126,6 +126,11 @@ public class LinuxDevInputController extends Controller implements Runnable{
|
|||||||
return newData;
|
return newData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doSleepAfterPollingData() {
|
||||||
|
//This is event driven (aka pollLatestData() is blocking anyway until we have data), we don't need to sleep it all.
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroyDriver() {
|
public void destroyDriver() {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user