mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-05 23:36:12 +00:00
Random variable tweaks & opts
This commit is contained in:
@@ -43,15 +43,29 @@ public class SemaphoreStream<T> extends BasicStream<T> {
|
||||
|
||||
@Override
|
||||
public T get(double x, double z) {
|
||||
synchronized(getTypedSource()) {
|
||||
return getTypedSource().get(x, z);
|
||||
try {
|
||||
semaphore.acquire();
|
||||
T t = getTypedSource().get(x, z);
|
||||
semaphore.release();
|
||||
return t;
|
||||
} catch(InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T get(double x, double y, double z) {
|
||||
synchronized(getTypedSource()) {
|
||||
return getTypedSource().get(x, y, z);
|
||||
try {
|
||||
semaphore.acquire();
|
||||
T t = getTypedSource().get(x, y, z);
|
||||
semaphore.release();
|
||||
return t;
|
||||
} catch(InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user