mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-21 15:57:38 +00:00
Random variable tweaks & opts
This commit is contained in:
1 parent
62c2757afc
commit
32a0fc9b17
13 files changed
+34
-45
No files matched your search
@@ -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