KT-4825 Implement "synchronized" properly via monitorenter/monitorexit
#KT-4825 Fixed
This commit is contained in:
@@ -20,6 +20,7 @@ import kotlin.Function0;
|
||||
import kotlin.IntRange;
|
||||
import kotlin.KotlinNullPointerException;
|
||||
|
||||
import java.lang.Deprecated;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@@ -87,6 +88,8 @@ public class Intrinsics {
|
||||
return new IntRange(0, length - 1);
|
||||
}
|
||||
|
||||
// TODO: remove this function when ABI version is advanced
|
||||
@Deprecated // A better implementation of synchronized is used now
|
||||
public static <R> R stupidSync(Object lock, Function0<R> block) {
|
||||
synchronized (lock) {
|
||||
return block.invoke();
|
||||
|
||||
Reference in New Issue
Block a user