2faaefac by Nathan Lighthart

Remove UPGM synchronization

- Remove lock guarding against multiple hru's initializing at the same time
- Remove synchronization wrapper on library

Note: These are longer needed as the file handles are now separate for each HRU
1 parent 4a47859e
......@@ -32,15 +32,12 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.time.LocalDate;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Upgm {
private static double acycon = 10000.0;
private static final Path tempLibDir;
private static final Lock initLock = new ReentrantLock();
static {
Path tempDir;
......@@ -178,14 +175,10 @@ public class Upgm {
Jupgminit.shootoutfile = outParent.resolve("shoot" + idString + ".out").toString();
Jupgminit.hruid = hruID;
initLock.lock();
try {
Jupgminit.exec();
} catch (Exception ex) {
Logger.getLogger(Upgm.class.getName()).log(Level.SEVERE, null, ex);
return;
} finally {
initLock.unlock();
}
}
......@@ -272,7 +265,6 @@ public class Upgm {
String libName = "upgm" + hruID;
NativeLibrary.addSearchPath(libName, tempLibDir.toString());
lib = (nap.Libupgm) Native.loadLibrary(libName, nap.Libupgm.class);
lib = (nap.Libupgm) Native.synchronizedLibrary(lib);
Jupgm.lib = lib;
Jupgminit.lib = lib;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!