synchronized method
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package jet.runtime;
|
||||
|
||||
import jet.Function0;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@@ -29,6 +31,12 @@ public class Intrinsics {
|
||||
return (thisVal == anotherVal ? 0 : (anotherVal ? 1 : -1));
|
||||
}
|
||||
|
||||
public static <R> R stupidSync(Object lock, Function0<R> block) {
|
||||
synchronized (lock) {
|
||||
return block.invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private static Throwable sanitizeStackTrace(Throwable throwable) {
|
||||
StackTraceElement[] stackTrace = throwable.getStackTrace();
|
||||
ArrayList<StackTraceElement> list = new ArrayList<StackTraceElement>();
|
||||
|
||||
Reference in New Issue
Block a user