mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Assert that version checking won't throw on startup (#1512)
# Overview Previously if the coproc came up later, getProperty would return the string literal "null", which made us print the BFW. Add tests to make sure that we don't do that anymore by rebooting a sim coproc + robot in a combination of different orders.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
package org.photonvision.jni;
|
||||
|
||||
public class TimeSyncServer {
|
||||
private final Object mutex = new Object();
|
||||
private long handle;
|
||||
|
||||
public TimeSyncServer(int port) {
|
||||
@@ -25,7 +26,13 @@ public class TimeSyncServer {
|
||||
}
|
||||
|
||||
public void start() {
|
||||
TimeSyncServer.start(handle);
|
||||
synchronized (mutex) {
|
||||
if (handle > 0) {
|
||||
TimeSyncServer.start(handle);
|
||||
} else {
|
||||
System.err.println("TimeSyncServer: use after free?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
|
||||
Reference in New Issue
Block a user