Provide lazy implementation with an external object to synchronize on.

This commit is contained in:
Ilya Gorbunov
2015-09-01 18:46:27 +03:00
parent 4fbf787f7d
commit b3073dbd2d
5 changed files with 46 additions and 3 deletions
+6
View File
@@ -62,6 +62,12 @@ public fun lazy<T>(initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
* The [mode] parameter is ignored. */
public fun lazy<T>(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
/**
* Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].
*
* The [lock] parameter is ignored.
*/
public fun lazy<T>(lock: Any?, initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
private fun arrayCopyResize(source: dynamic, newSize: Int, defaultValue: Any?): dynamic {
val result = source.slice(0, newSize)